-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mtab: Use mount IDs instead of dev_t for bfs_fstype()
This fixes -fstype on btrfs subvolumes, which previously reported "unknown" due to their dev_t being potentially different from the mount point. Link: https://savannah.gnu.org/bugs/?50859 Link: https://lwn.net/Articles/866582/
- Loading branch information
1 parent
5fee84b
commit 0dccdae
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mnt | ||
mnt/file | ||
mnt/subvol | ||
mnt/subvol/file |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Test that -fstype works in btrfs subvolumes | ||
|
||
command -v btrfs &>/dev/null || skip | ||
|
||
cd "$TEST" | ||
|
||
# Make a btrfs filesystem image | ||
truncate -s128M img | ||
mkfs.btrfs img >&2 | ||
|
||
# Mount it | ||
mkdir mnt | ||
bfs_sudo mount img mnt || skip | ||
defer bfs_sudo umount mnt | ||
|
||
# Make it owned by us | ||
bfs_sudo chown "$(id -u):$(id -g)" mnt | ||
|
||
# Create a subvolume inside it | ||
btrfs subvolume create mnt/subvol >&2 | ||
|
||
# Make a file in and outside the subvolume | ||
"$XTOUCH" mnt/file mnt/subvol/file | ||
|
||
bfs_diff mnt -fstype btrfs -print -o -printf '%p %F\n' |