All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Christian Schoenebeck <linux_oss@crudebyte.com>,
	Tyler Hicks <tyhicks@linux.microsoft.com>,
	Eric Van Hensbergen <ericvh@gmail.com>,
	Latchesar Ionkov <lucho@ionkov.net>,
	Dominique Martinet <asmadeus@codewreck.org>
Cc: v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH 03/06] 9p: v9fs_fid_lookup_with_uid fix's fix suggestion
Date: Sun, 12 Jun 2022 17:53:26 +0900	[thread overview]
Message-ID: <20220612085330.1451496-4-asmadeus@codewreck.org> (raw)
In-Reply-To: <20220612085330.1451496-1-asmadeus@codewreck.org>

Tyler, I can just squash this in your commit if you're ok with this,
as I've already rebased the other patches on top of it.

Cc: Tyler Hicks <tyhicks@linux.microsoft.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
---
 fs/9p/fid.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 5a469b79c1ee..baf2b152229e 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -221,12 +221,15 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
 		 * walk to ensure none of the patch component change
 		 */
 		fid = p9_client_walk(fid, l, &wnames[i], clone);
-		p9_client_clunk(old_fid);
+		/* non-cloning walk will return the same fid */
+		if (fid != old_fid) {
+			p9_client_clunk(old_fid);
+			old_fid = fid;
+		}
 		if (IS_ERR(fid)) {
 			kfree(wnames);
 			goto err_out;
 		}
-		old_fid = fid;
 		i += l;
 		clone = 0;
 	}
-- 
2.35.1


  parent reply	other threads:[~2022-06-12  8:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12  8:53 [PATCH 00/06] fid refcounting improvements and fixes Dominique Martinet
2022-06-12  8:53 ` [PATCH 01/06] 9p: fix fid refcount leak in v9fs_vfs_atomic_open_dotl Dominique Martinet
2022-06-13 16:27   ` Tyler Hicks
2022-06-14 13:17   ` Christian Schoenebeck
2022-06-12  8:53 ` [PATCH 02/06] 9p: fix fid refcount leak in v9fs_vfs_get_link Dominique Martinet
2022-06-13 16:29   ` Tyler Hicks
2022-06-14 13:19   ` Christian Schoenebeck
2022-06-12  8:53 ` Dominique Martinet [this message]
2022-06-13 20:08   ` [PATCH 03/06] 9p: v9fs_fid_lookup_with_uid fix's fix suggestion Tyler Hicks
2022-06-12  8:53 ` [PATCH 04/06] 9p fid refcount: add p9_fid_get/put wrappers Dominique Martinet
2022-06-12 23:45   ` [PATCH v2 " Dominique Martinet
2022-06-13 17:31     ` Tyler Hicks
2022-06-14 13:55     ` Christian Schoenebeck
2022-06-14 14:27       ` Dominique Martinet
2022-06-15  3:16       ` [PATCH v3 " Dominique Martinet
2022-06-15 13:00         ` Christian Schoenebeck
2022-06-15 13:47           ` Dominique Martinet
2022-06-12  8:53 ` [PATCH 05/06] 9p fid refcount: add a 9p_fid_ref tracepoint Dominique Martinet
2022-06-12 22:46   ` Steven Rostedt
2022-06-12 23:46     ` [PATCH v2 " Dominique Martinet
2022-06-13  7:00       ` Dominique Martinet
2022-06-12  8:53 ` [PATCH 06/06] 9p fid refcount: cleanup p9_fid_put calls Dominique Martinet
2022-06-13 17:55   ` Tyler Hicks
2022-06-13 19:50     ` Dominique Martinet
2022-06-13 20:12       ` Tyler Hicks
2022-06-13 20:20 ` [PATCH 00/06] fid refcounting improvements and fixes Tyler Hicks
2022-06-13 21:00   ` Dominique Martinet
2022-06-14  1:14     ` Tyler Hicks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220612085330.1451496-4-asmadeus@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=ericvh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=tyhicks@linux.microsoft.com \
    --cc=v9fs-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.