Skip to content

Commit

Permalink
bcachefs: bch2_inum_path() now crosses subvolumes correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
Kent Overstreet committed Dec 24, 2024
1 parent 493fd70 commit 379189f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/bcachefs/fs-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

Expand Down

0 comments on commit 379189f

Please sign in to comment.