diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-02-05 16:53:27 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-02-06 10:38:45 -0500 |
commit | 0dccdae4510ff5603247be871e64a6119647ea2a (patch) | |
tree | cfaa57da443ec52ac4b74e40e29654576db1be42 /src/mtab.c | |
parent | 5fee84b972a381301cd78f42e1190115c4bed8a5 (diff) | |
download | bfs-0dccdae4510ff5603247be871e64a6119647ea2a.tar.xz |
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/
Diffstat (limited to 'src/mtab.c')
-rw-r--r-- | src/mtab.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -256,7 +256,7 @@ static int bfs_mtab_fill_types(struct bfs_mtab *mtab) { continue; } - if (trie_set_mem(&mtab->types, &sb.dev, sizeof(sb.dev), mount->type) != 0) { + if (trie_set_mem(&mtab->types, &sb.mnt_id, sizeof(sb.mnt_id), mount->type) != 0) { goto fail; } } @@ -279,7 +279,7 @@ const char *bfs_fstype(const struct bfs_mtab *mtab, const struct bfs_stat *statb } } - const char *type = trie_get_mem(&mtab->types, &statbuf->dev, sizeof(statbuf->dev)); + const char *type = trie_get_mem(&mtab->types, &statbuf->mnt_id, sizeof(statbuf->mnt_id)); if (type) { return type; } else { |