Re: [PATCH RFC V5 2/4] btrfs: use latest_dev in btrfs_show_devname
From: David Sterba <hidden>
Date: 2021-09-02 13:47:36
On Tue, Aug 24, 2021 at 01:05:20PM +0800, Anand Jain wrote:
RFC because, With this patch, /proc/self/mounts might not show the lowest devid device as we did before. Instead we show the device that has the greatest generation and, we used it to build the tree. IMO it is ok because /proc/self/mounts should show a device the belongs to the fsid not, necessarily the lowest devid device as devid is internal to btrfs. IMO this won't affect the ABI?
I tend to agree, the only thing that should be consistent that any
number of mounts of the same filesystem (eg. by subvolume) should print
the same device path. But given that fs_devices is shared then the same
output is guaranteed. The time when the latest_bdev changes is after
remove or replace, that's an intermediate state so the results may vary.
And maybe when printing the device by which the fs was mounted is more
correct, as it may be different from the lowest id and that could
potentially be confusing. The commit 9c5085c14798 ("Btrfs: implement
->show_devname") adding the show_devname callback even mentions not
showing the mount device as a drawback. The multi-device fs devices
should be treated equally for the purpose of mount.