On 19/09/2023 06:21, Guilherme G. Piccoli wrote:
On 18/09/2023 18:52, David Sterba wrote:
[...]
Let's stick to temp-fsid for now, I like that it says the fsid is
temporary, virtual could be potentially stored permanently (like another
metadata_uuid).
I've added the patch to for-next, with some fixups, mostly stylistic.
I'll add the btrfs-progs part soon so we have the support for testing.
The feature seems to be complete regarding the original idea, if you
have any updates please send them separate patches or replies to this
thread. Thanks.
Thanks a bunch David, much appreciated!
BTW, thanks a lot all reviewers, was a great and productive discussion.
For testing, likely you're aware but I think doesn't harm to mention
here as well: there's a fstests case for this feature here ->
This must successfully pass the remaining Btrfs fstests test cases with
the MKFS_OPTION="-O temp-fsid" configuration option, or it should call
not run for the incompatible feature.
I have observed that the following test case is failing with this patch:
$ mkfs.btrfs -fq /dev/sdb1 :0
$ btrfstune --convert-to-temp-fsid /dev/sdb1 :0
$ mount /dev/sdb1 /btrfs :0
Mount /dev/sdb1 again at a different mount point and look for the copied
file 'messages':
$ cp /var/log/messages /btrfs :0
$ mount /dev/sdb1 /btrfs1 :0
$ ls -l /btrfs1 :0
total 0 <-- empty
The copied file is missing because we consider each mount as a new fsid.
This means subvolume mounts are also not working. Some operating systems
mount $HOME as a subvolume, so those won't work either.
To resolve this, we can use devt to match in the device list and find
the matching fs_devices or NULL.
Thanks, Anand
https://lore.kernel.org/linux-btrfs/20230913224545.3940971-1-gpiccoli@xxxxxxxxxx/