diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-21 04:16:00 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-25 02:41:37 +0100 |
commit | 1f626223a0c8753f8f5c651bf7bfc9e3cfdef7f7 (patch) | |
tree | 763cc6574766435db4935526ceea2e730d4dd204 | |
parent | bcachefs: Fix missing va_end() (diff) | |
download | linux-1f626223a0c8753f8f5c651bf7bfc9e3cfdef7f7.tar.xz linux-1f626223a0c8753f8f5c651bf7bfc9e3cfdef7f7.zip |
bcachefs: fix backpointer_to_text() when dev does not exist
Fixes:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/backpointers.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c index b4dc319bcb2b..569b97904da4 100644 --- a/fs/bcachefs/backpointers.c +++ b/fs/bcachefs/backpointers.c @@ -68,9 +68,11 @@ void bch2_backpointer_to_text(struct printbuf *out, const struct bch_backpointer void bch2_backpointer_k_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c k) { - prt_str(out, "bucket="); - bch2_bpos_to_text(out, bp_pos_to_bucket(c, k.k->p)); - prt_str(out, " "); + if (bch2_dev_exists2(c, k.k->p.inode)) { + prt_str(out, "bucket="); + bch2_bpos_to_text(out, bp_pos_to_bucket(c, k.k->p)); + prt_str(out, " "); + } bch2_backpointer_to_text(out, bkey_s_c_to_backpointer(k).v); } |