]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcachefs: fix backpointer_to_text() when dev does not exist
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 21 Feb 2024 03:16:00 +0000 (22:16 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 25 Feb 2024 01:41:37 +0000 (20:41 -0500)
Fixes:
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/backpointers.c

index b4dc319bcb2bc0a5363e74f6d2096d3b5652599d..569b97904da42eec8975e8662dd78895d41d62fe 100644 (file)
@@ -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);
 }