From: Jeff Layton <jlayton@kernel.org>
To: NeilBrown <neil@brown.name>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
Amir Goldstein <amir73il@gmail.com>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 03/11] VFS/nfsd/cachefiles/ovl: add start_creating() and end_creating()
Date: Tue, 30 Sep 2025 06:19:38 -0400 [thread overview]
Message-ID: <14157372cc08451bfa75d057dc8aed2f44c02ded.camel@kernel.org> (raw)
In-Reply-To: <175921066852.1696783.17363248489652049263@noble.neil.brown.name>
On Tue, 2025-09-30 at 15:37 +1000, NeilBrown wrote:
> On Mon, 29 Sep 2025, Jeff Layton wrote:
> > On Fri, 2025-09-26 at 12:49 +1000, NeilBrown wrote:
> > > From: NeilBrown <neil@brown.name>
> > >
> > > start_creating() is similar to simple_start_creating() but is not so
> > > simple.
> > > It takes a qstr for the name, includes permission checking, and does NOT
> > > report an error if the name already exists, returning a positive dentry
> > > instead.
>
>
>
> > >
> > > - if (!d_is_negative(dentry)) {
> > > + while (!d_is_negative(dentry)) {
> >
> > Can you explain why this changed from an if to a while? The existing
> > code doesn't seem to ever retry this operation.
>
> I tried to explain that in the commit message:
>
> > Occasionally this change means that the parent lock is held for a
> > shorter period of time, for example in cachefiles_commit_tmpfile().
> > As this function now unlocks after an unlink and before the following
> > lookup, it is possible that the lookup could again find a positive
> > dentry, so a while loop is introduced there.
>
> Is there something I could do to make that clearer?
>
Clearly I didn't read the commit message well enough. Nothing I can
think of.
> ....
> > > @@ -1828,12 +1822,6 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
> > > }
> > > out:
> > > return err != nfs_ok ? err : nfserrno(host_err);
> > > -
> > > -out_dput:
> > > - dput(dnew);
> > > -out_unlock:
> > > - inode_unlock(dirp);
> > > - goto out_drop_write;
> > > }
> > >
> > >
> >
> >
> > I do quite like the nfsd cleanup though!
> >
> >
>
> Thanks!
>
> NeilBrown
You can add:
Reviewed-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2025-09-30 10:19 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 2:49 [PATCH 00/11] Create APIs to centralise locking for directory ops NeilBrown
2025-09-26 2:49 ` [PATCH 01/11] debugfs: rename end_creating() to debugfs_end_creating() NeilBrown
2025-09-27 9:13 ` Amir Goldstein
2025-09-27 11:29 ` Jeff Layton
2025-09-26 2:49 ` [PATCH 02/11] VFS: introduce start_dirop() and end_dirop() NeilBrown
2025-09-26 16:41 ` Amir Goldstein
2025-09-27 11:32 ` NeilBrown
2025-09-26 2:49 ` [PATCH 03/11] VFS/nfsd/cachefiles/ovl: add start_creating() and end_creating() NeilBrown
2025-09-29 12:37 ` Jeff Layton
2025-09-30 5:37 ` NeilBrown
2025-09-30 10:19 ` Jeff Layton [this message]
2025-09-30 8:54 ` Amir Goldstein
2025-10-01 3:15 ` NeilBrown
2025-10-02 10:52 ` Amir Goldstein
2025-09-26 2:49 ` [PATCH 04/11] VFS/nfsd/cachefiles/ovl: introduce start_removing() and end_removing() NeilBrown
2025-09-27 9:12 ` Amir Goldstein
2025-10-02 17:02 ` Jeff Layton
2025-09-26 2:49 ` [PATCH 05/11] VFS: introduce start_creating_noperm() and start_removing_noperm() NeilBrown
2025-09-28 12:26 ` Amir Goldstein
2025-10-02 17:13 ` Jeff Layton
2025-09-26 2:49 ` [PATCH 06/11] VFS: introduce start_removing_dentry() NeilBrown
2025-09-27 9:32 ` Amir Goldstein
2025-09-27 11:55 ` NeilBrown
2025-10-02 17:19 ` Jeff Layton
2025-09-26 2:49 ` [PATCH 07/11] VFS: add start_creating_killable() and start_removing_killable() NeilBrown
2025-09-28 12:05 ` Amir Goldstein
2025-09-29 1:44 ` NeilBrown
2025-09-26 2:49 ` [PATCH 08/11] VFS/nfsd/ovl: introduce start_renaming() and end_renaming() NeilBrown
2025-09-29 11:23 ` Amir Goldstein
2025-09-26 2:49 ` [PATCH 09/11] VFS/ovl/smb: introduce start_renaming_dentry() NeilBrown
2025-09-26 15:43 ` kernel test robot
2025-09-26 17:17 ` kernel test robot
2025-09-30 7:08 ` Amir Goldstein
2025-10-01 1:45 ` NeilBrown
2025-10-02 10:56 ` Amir Goldstein
2025-10-01 4:35 ` NeilBrown
2025-09-26 2:49 ` [PATCH 10/11] Add start_renaming_two_dentrys() NeilBrown
2025-09-30 7:46 ` Amir Goldstein
2025-10-01 4:14 ` NeilBrown
2025-09-26 2:49 ` [PATCH 11/11] ecryptfs: use new start_creaing/start_removing APIs NeilBrown
2025-09-26 16:03 ` kernel test robot
2025-09-28 12:50 ` Amir Goldstein
2025-09-29 5:26 ` NeilBrown
2025-09-29 7:53 ` Amir Goldstein
2025-10-01 1:31 ` NeilBrown
2025-10-02 10:25 ` Amir Goldstein
2025-09-26 15:47 ` [PATCH 00/11] Create APIs to centralise locking for directory ops Amir Goldstein
2025-09-27 11:20 ` NeilBrown
2025-10-01 5:04 ` NeilBrown
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=14157372cc08451bfa75d057dc8aed2f44c02ded.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=neil@brown.name \
--cc=viro@zeniv.linux.org.uk \
/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.