Re: [PATCH v3 0/4] fs: export __mnt_{want,drop}_write to modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 17, 2023 at 4:38 PM Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> On Thu, Aug 17, 2023 at 08:44:46AM +0300, Amir Goldstein wrote:
> > overlayfs is going to use those to grab a write reference on the
> > upper fs during copy up.
> >
> > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
> > ---
> >
> > Christian,
> >
> > This patch is needed for the ovl_want_write() changes [1],
> > which I forgot to CC you on.
> >
> > Please ACK if you approve.
> >
> > Thanks,
> > Amir.
> >
> > [1] https://lore.kernel.org/linux-unionfs/20230816152334.924960-1-amir73il@xxxxxxxxx/
> >
> >  fs/namespace.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/fs/namespace.c b/fs/namespace.c
> > index e157efc54023..370328b204f1 100644
> > --- a/fs/namespace.c
> > +++ b/fs/namespace.c
> > @@ -386,6 +386,7 @@ int __mnt_want_write(struct vfsmount *m)
> >
> >       return ret;
> >  }
> > +EXPORT_SYMBOL_GPL(__mnt_want_write);
>
> Puh, not excited about that but also no real reason to say no other than
> generic worries about it being abused.
> But maybe let's not export underscore variants. Might make sense to at
> least name them differently? mnt_want_write_locked()?

Heh, it's not locked. It happens to be called with sb_start_write() from
mnt_want_write(), but from do_dentry_open() it's actually called *before*
file_start_write(), because the mnt_writers refcount and sb_writers lock
are not strictly ordered, which is very convenient for ovl copy up.

We could go for mnt_{get,put}_write(), but that's a bit close to
mnt_get_writers().

We could go for mnt_{get,put}_write_access(), like helpers with similar
names for inode.

I don't really mind, as long as this doesn't become a bike shedding thing...

Thanks,
Amir.




[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux