Re: [PATCH v3 06/13] vfs: make vfs_create break delegations on parent directory

Jeff Layton <[email protected]>
Newsgroups org.kernel.vger.ecryptfs,dev.linux.lists.netfs,org.kernel.vger.linux-cifs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs,org.kernel.vger.linux-unionfs,org.kernel.vger.linux-xfs,org.kernel.vger.netdev
Message-ID <[email protected]>
On Wed, 2025-10-29 at 14:23 +0100, Christian Brauner wrote:
> On Tue, Oct 21, 2025 at 11:25:41AM -0400, Jeff Layton wrote:
> > In order to add directory delegation support, we need to break
> > delegations on the parent whenever there is going to be a change in the
> > directory.
> > 
> > Add a delegated_inode parameter to vfs_create. Most callers are
> > converted to pass in NULL, but do_mknodat() is changed to wait for a
> > delegation break if there is one.
> > 
> > Reviewed-by: Jan Kara <[email protected]>
> > Reviewed-by: NeilBrown <[email protected]>
> > Signed-off-by: Jeff Layton <[email protected]>
> > ---
> >  fs/ecryptfs/inode.c      |  2 +-
> >  fs/namei.c               | 26 +++++++++++++++++++-------
> >  fs/nfsd/nfs3proc.c       |  2 +-
> >  fs/nfsd/vfs.c            |  3 +--
> >  fs/open.c                |  2 +-
> >  fs/overlayfs/overlayfs.h |  2 +-
> >  fs/smb/server/vfs.c      |  2 +-
> >  include/linux/fs.h       |  2 +-
> >  8 files changed, 26 insertions(+), 15 deletions(-)
> > 
> > diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
> > index 88631291b32535f623a3fbe4ea9b6ed48a306ca0..661709b157ce854c3bfdfdb13f7c10435fad9756 100644
> > --- a/fs/ecryptfs/inode.c
> > +++ b/fs/ecryptfs/inode.c
> > @@ -189,7 +189,7 @@ ecryptfs_do_create(struct inode *directory_inode,
> >  	rc = lock_parent(ecryptfs_dentry, &lower_dentry, &lower_dir);
> >  	if (!rc)
> >  		rc = vfs_create(&nop_mnt_idmap, lower_dir,
> > -				lower_dentry, mode, true);
> > +				lower_dentry, mode, true, NULL);
> 
> Starts to look like we should epxlore whether a struct create_args (or
> some other name) similar to struct renamedata I did some years ago would
> help make the code a bit more legible in the future.

I like that idea. Let me see if I can rework this patch along those
lines. I'll plan to send an updated set.

Thanks,
-- 
Jeff Layton <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.