Skip to content

Commit 1f62622

Browse files
author
Kent Overstreet
committed
bcachefs: fix backpointer_to_text() when dev does not exist
Fixes: Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 816054f commit 1f62622

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/bcachefs/backpointers.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ void bch2_backpointer_to_text(struct printbuf *out, const struct bch_backpointer
6868

6969
void bch2_backpointer_k_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c k)
7070
{
71-
prt_str(out, "bucket=");
72-
bch2_bpos_to_text(out, bp_pos_to_bucket(c, k.k->p));
73-
prt_str(out, " ");
71+
if (bch2_dev_exists2(c, k.k->p.inode)) {
72+
prt_str(out, "bucket=");
73+
bch2_bpos_to_text(out, bp_pos_to_bucket(c, k.k->p));
74+
prt_str(out, " ");
75+
}
7476

7577
bch2_backpointer_to_text(out, bkey_s_c_to_backpointer(k).v);
7678
}

0 commit comments

Comments
 (0)