Re: [PATCH RFC 08/24] vfs: make vfs_mknod break delegations on parent directory

From: Christian Brauner
Date: Fri Mar 22 2024 - 10:14:15 EST


On Wed, Mar 20, 2024 at 04:12:29PM -0400, Jeff Layton wrote:
> On Wed, 2024-03-20 at 14:42 +0100, Christian Brauner wrote:
> > >  int vfs_mknod(struct mnt_idmap *, struct inode *, struct dentry *,
> > > - umode_t, dev_t);
> > > + umode_t, dev_t, struct inode **);
> >
> > So we will have at least the following helpers with an additional
> > delegated inode argument.
> >
> > vfs_unlink()
> > vfs_link()
> > notify_change()
> > vfs_create()
> > vfs_mknod()
> > vfs_mkdir()
> > vfs_rmdir()
> >
> > From looking at callers all these helpers will be called with non-NULL
> > delegated inode argument in vfs only. Unless it is generally conceivable
> > that other callers will want to pass a non-NULL inode argument over time
> > it might make more sense to add vfs_<operation>_delegated() or
> > __vfs_<operation>() and make vfs_mknod() and friends exported wrappers
> > around it.
> >
> > I mean it's a matter of preference ultimately but this seems cleaner to
> > me. So at least for the new ones we should consider it. Would also make
> > the patch smaller.
> >
>
> Good suggestion. I just respun along those lines and it's a lot cleaner.
> I'm still testing it but here is the new diffstat. It's a little larger
> actually, but it keeps the changes more confined to namei.c:

Sounds good to me!