Skip to content

Commit bdedae7

Browse files
author
Kent Overstreet
committed
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 <[email protected]>
1 parent ce9a217 commit bdedae7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/bcachefs/fs-common.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,9 @@ int bch2_inum_to_path(struct btree_trans *trans, subvol_inum inum, struct printb
608608
goto disconnected;
609609
}
610610

611+
inum.subvol = inode.bi_parent_subvol ?: inum.subvol;
612+
inum.inum = inode.bi_dir;
613+
611614
u32 snapshot;
612615
ret = bch2_subvolume_get_snapshot(trans, inum.subvol, &snapshot);
613616
if (ret)
@@ -626,10 +629,6 @@ int bch2_inum_to_path(struct btree_trans *trans, subvol_inum inum, struct printb
626629

627630
prt_char(path, '/');
628631

629-
if (d.v->d_type == DT_SUBVOL)
630-
inum.subvol = le32_to_cpu(d.v->d_parent_subvol);
631-
inum.inum = d.k->p.inode;
632-
633632
bch2_trans_iter_exit(trans, &d_iter);
634633
}
635634

0 commit comments

Comments
 (0)