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

From: Jeff Layton

Date: Wed Oct 29 2025 - 09:38:27 EST


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 <jack@xxxxxxx>
> > Reviewed-by: NeilBrown <neil@xxxxxxxxxx>
> > Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> > ---
> > 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 <jlayton@xxxxxxxxxx>