Re: [PATCH v2 17/21] backing-inode: add backing_inode_copyattr()

Amir Goldstein <[email protected]> Tue, 19 May 2026 13:47:40 +0200
Newsgroups org.kernel.vger.linux-unionfs,dev.linux.lists.fuse-devel
Message-ID <CAOQ4uxiXYmi+LUcETe_ftYzUN_KhPz9aNAe_yiX+kCBYt+zDXw@mail.gmail.com>
On Tue, May 19, 2026 at 1:21 AM Joanne Koong <[email protected]> wrote:
>
> On Sat, May 16, 2026 at 2:33 PM Amir Goldstein <[email protected]> wrote:
> >
> > On Sat, May 16, 2026 at 2:53 AM Joanne Koong <[email protected]> wrote:
> > >
> > > Move logic in ovl_copyattr() to a generic backing_inode_copyattr()
> > > function in a new fs/backing-inode.c, which other filesystems that use
> > > backing inodes (eg fuse passthrough) will use.
> > >
> > > Signed-off-by: Joanne Koong <[email protected]>
> > > ---
> > >  fs/Makefile                   |  2 +-
> > >  fs/backing-inode.c            | 43 +++++++++++++++++++++++++++++++++++
> > >  fs/overlayfs/util.c           | 33 +++------------------------
> > >  include/linux/backing-inode.h | 14 ++++++++++++
> >
> >
> > Nice!
> >
> > Please add these files to
> > FILESYSTEMS [STACKABLE]
> > section in MAINTAINERS.
> >
> > Otherwise, feel free to add:
> > Reviewed-by: Amir Goldstein <[email protected]>
> >
> > There is one more cleanup patch required, now or later, to get rid of
> > some awkwardness in kernel fs code.
> > If you don't want to deal with it, I can take this cleanup later.
> >
> > d_backing_inode() is a noop from the day it was added and has 177
> > call sites. Those call sites should be converted to d_inode() and
> > d_backing_inode() should go away.
> >
> > backing_inode_security{,_novalidate}() are likewise unneeded
> > dups of inode_security{,_novalidate}() and should be removed.
>
> Awesome! I'm happy to remove these.
>
> You mentioned in v1 that fs/stack.c and the corresponding
> include/linux/fs_stack.h are pretty much only used by ecryptfs. It
> looks like there are only two pretty minimal functions in there. Do
> you think it's also worth moving that logic into ecryptfs and
> eliminating fs stack?

I wanted to do this once, but ecryptfs is not actively maintained
(odd fixes only), so the maintainer did not want to take any changes.
Let's leave it.

Thanks,
Amir.