FUSE: anyway to return different stat::st_dev inside one filesystem?
Hi FUSE guys,
Normally it's completely sane to let FUSE manage stat::st_dev, and most FUSE filesystems are fine with that.
But there comes one problem, as I'm working on a FUSE btrfs read-only implementation (*).
This limitation is getting more user affecting, as btrfs has subvolumes which are completely different inode spaces.
Furthermore, all subvolume roots shares the same inode number (256), thus if user space tool like "find" gets a inode number 256 with same the st_dev number, it will treat it as a known directory, and skip its content completely.
For kernel btrfs, it's not a big deal, as we will return different st_dev for each subvolume.
But in FUSE, we don't have such ability, resulting "find" can only work inside one subvolume, and nothing more.
So is there any limitation why FUSE can't not return different st_dev?
*: The project is here:
https://github.com/adam900710/btrfs-fuse
The reason I created such project is as an educational project, also an alternative btrfs reference implementation for bootloaders.
Currently one can already explore the directory/files structure, and proper data read with checksum verification/recovery is WIP.
Thanks,
Qu
Quoted 2 lines · Qu Wenruo
For kernel btrfs, it's not a big deal, as we will return different
st_devfor each subvolume.
It is a big deal, as that behavior does break things and has been the source of constant troubnle and discussion. It needs to be fixed in btrfs eventually and absolutely not spread any further.