diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-12-24 05:16:56 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-01-09 23:38:41 -0500 |
commit | bdedae70f51f570381095a59740d6a9df1262668 (patch) | |
tree | 8ec627ca229b4963f062593f42da8eee66b126e8 /fs/bcachefs | |
parent | ce9a21713bfd9744ae4cbfef1b4d8bc895ab7283 (diff) |
bcachefs: bch2_inum_path() now crosses subvolumes correctly
The dirent that points to a subvolume root is in the parent subvolume.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/fs-common.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/bcachefs/fs-common.c b/fs/bcachefs/fs-common.c index 63619318c64a..2c3d46ac70c6 100644 --- a/fs/bcachefs/fs-common.c +++ b/fs/bcachefs/fs-common.c @@ -608,6 +608,9 @@ int bch2_inum_to_path(struct btree_trans *trans, subvol_inum inum, struct printb goto disconnected; } + inum.subvol = inode.bi_parent_subvol ?: inum.subvol; + inum.inum = inode.bi_dir; + u32 snapshot; ret = bch2_subvolume_get_snapshot(trans, inum.subvol, &snapshot); if (ret) @@ -626,10 +629,6 @@ int bch2_inum_to_path(struct btree_trans *trans, subvol_inum inum, struct printb prt_char(path, '/'); - if (d.v->d_type == DT_SUBVOL) - inum.subvol = le32_to_cpu(d.v->d_parent_subvol); - inum.inum = d.k->p.inode; - bch2_trans_iter_exit(trans, &d_iter); } |