Re: [PATCH/RFC] NFSD: handle BTRFS subvolumes better.

J. Bruce Fields
2021-07-20T22:11:35Z

On Thu, Jul 15, 2021 at 02:01:11PM -0400, Josef Bacik wrote:
> The problem I ran into was the automount stuff requires that we have a
> completely different superblock for every vfsmount. This is fine for
> things like nfs or samba where the automount literally points to a
> completely different mount, but doesn't work for btrfs where it's on
> the same file system. If you have 1000 subvolumes and run sync()
> you're going to write the superblock 1000 times for the same file
> system.

Dumb question: why do you have to write the superblock 1000 times, and
why is that slower than writing to 1000 different filesystems?

> You are
> going to reclaim inodes on the same file system 1000 times. You are
> going to reclaim dcache on the same filesytem 1000 times. You are
> also going to pin 1000 dentries/inodes into memory whenever you
> wander into these things because the super is going to hold them
> open.

That last part at least is the same for the 1000-different-filesystems
case, isn't it?

--b.

> This is not a workable solution. It's not a matter of simply tying
> into existing infrastructure, we'd have to completely rework how the
> VFS deals with this stuff in order to be reasonable. And when I
> brought this up to Al he told me I was insane and we absolutely had
> to have a different SB for every vfsmount, which means we can't use
> vfsmount for this, which means we don't have any other options.
> Thanks,
>
> Josef