Re: A Third perspective on BTRFS nfsd subvol dev/inode number issues.
From: NeilBrown <hidden>
Date: 2021-08-02 21:10:56
Also in:
linux-fsdevel, linux-nfs
From: NeilBrown <hidden>
Date: 2021-08-02 21:10:56
Also in:
linux-fsdevel, linux-nfs
On Mon, 02 Aug 2021, J. Bruce Fields wrote:
On Mon, Aug 02, 2021 at 02:18:29PM +1000, NeilBrown wrote:quoted
For btrfs, the "location" is root.objectid ++ file.objectid. I think the inode should become (file.objectid ^ swab64(root.objectid)). This will provide numbers that are unique until you get very large subvols, and very many subvols.If you snapshot a filesystem, I'd expect, at least by default, that inodes in the snapshot to stay the same as in the snapshotted filesystem.
As I said: we need to challenge and revise user-space (and meat-space) expectations. In btrfs, you DO NOT snapshot a FILESYSTEM. Rather, you effectively create a 'reflink' for a subtree (only works on subtrees that have been correctly created with the poorly named "btrfs subvolume" command). As with any reflink, the original has the same inode number that it did before, the new version has a different inode number (though in current BTRFS, half of the inode number is hidden from user-space, so it looks like the inode number hasn't changed). NeilBrown