fuse: add subvol_root_ino mount option for subvolume support#192
Open
ukernel wants to merge 1 commit into
Open
fuse: add subvol_root_ino mount option for subvolume support#192ukernel wants to merge 1 commit into
ukernel wants to merge 1 commit into
Conversation
Filesystems that support snapshots and subvolumes may have inodes with the same inode number across different subvolumes. When these inodes are accessed through the same FUSE mount, tools like cp(1) can incorrectly report "File X and Y are the same file" because they share the same device number (sb->s_dev). Add a new mount option "subvol_root_ino" that specifies the inode number of snapshot/subvolume root. When set, FUSE allocates unique anonymous block device ID for inodes whose orig_ino matches this value, and all inodes under that subvolume inherit the same device ID. This gives each subvolume a distinct device number in stat(2), avoiding inode number conflicts. The feature is implemented by: - Adding sub_dev to fuse_inode, to track per-subvolume device ID - Adding subvol_root_ino to fuse_conn - Extending fuse_iget and fuse_lookup_name to propagate sub_dev - Reporting fi->sub_dev in fuse_fillattr/fuse_getattr when set - Disabling NFS export_support when subvol_root_ino is enabled, since the two features are incompatible Signed-off-by: "Yan, Zheng" <ukernel@gmail.com>
Author
|
the reason we don't use submount feature is that: |
ukernel
requested review from
achhenderson and
hbirth
and removed request for
achhenderson and
hbirth
July 24, 2026 09:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filesystems that support snapshots and subvolumes may have inodes with the same inode number across different subvolumes. When these inodes are accessed through the same FUSE mount, tools like cp(1) can incorrectly report "File X and Y are the same file" because they share the same device number (sb->s_dev).
Add a new mount option "subvol_root_ino" that specifies the inode number of snapshot/subvolume root. When set, FUSE allocates unique anonymous block device ID for inodes whose orig_ino matches this value, and all inodes under that subvolume inherit the same device ID. This gives each subvolume a distinct device number in stat(2), avoiding inode number conflicts.
The feature is implemented by: