2021-07-15 16:53:11

by J. Bruce Fields

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

On Thu, Jul 15, 2021 at 02:37:52PM +1000, NeilBrown wrote:
> To fix this, we need to report a different fsid for each subvolume, but
> need to use the same fsid that we currently use for the top-level
> volume. Changing this (by rebooting a server to new code), might
> confuse the client. I don't think it would be a major problem (stale
> filehandles shouldn't happen), but it is best avoided.
...
> Again, we really want an API to get this from the filesystem. Changing
> it later has no cost, so we don't need any commitment from the btrfs team
> that this is what they will provide if/when we do get such an API.

"No cost" makes me a little nervous, are we sure nobody will notice the
mountd-on-fileid changing?

Fileid and fsid changes I'd worry about more, though I wouldn't rule it
out if that'd stand in the way of a bug fix.

Thanks for looking into this.

--b.


2021-07-15 23:09:13

by NeilBrown

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

On Fri, 16 Jul 2021, J. Bruce Fields wrote:
> On Thu, Jul 15, 2021 at 02:37:52PM +1000, NeilBrown wrote:
> > To fix this, we need to report a different fsid for each subvolume, but
> > need to use the same fsid that we currently use for the top-level
> > volume. Changing this (by rebooting a server to new code), might
> > confuse the client. I don't think it would be a major problem (stale
> > filehandles shouldn't happen), but it is best avoided.
> ...
> > Again, we really want an API to get this from the filesystem. Changing
> > it later has no cost, so we don't need any commitment from the btrfs team
> > that this is what they will provide if/when we do get such an API.
>
> "No cost" makes me a little nervous, are we sure nobody will notice the
> mountd-on-fileid changing?

One cannot be 100% sure, but I cannot see how anything would depend on
it being stable. Certainly the kernel doesn't.
'ls -i' doesn't report it - even as "ls -if". "find -inum xx" cannot see
it.
Obviously readdir() will see it but if any application put much weight
on the number, it could already get confused when btrfs returns
non-unique numbers as I mentioned.
I certainly wouldn't lose sleep over changing it.

NeilBrown

>
> Fileid and fsid changes I'd worry about more, though I wouldn't rule it
> out if that'd stand in the way of a bug fix.
>
> Thanks for looking into this.
>
> --b.
>
>