bcachefs: Improve some btree node read error messages
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 23 Feb 2022 15:32:43 +0000 (10:32 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:25 +0000 (17:09 -0400)
On btree node read error, it's helpful to see what we were trying to
read - was it all zeroes?

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_io.c

index a0446df0d3dad1aaaa854b5b336a574346226363..c65c640753b61b9bcc705944ab983afc925fa96e 100644 (file)
@@ -880,11 +880,12 @@ int bch2_btree_node_read_done(struct bch_fs *c, struct bch_dev *ca,
 
        btree_err_on(le64_to_cpu(b->data->magic) != bset_magic(c),
                     BTREE_ERR_MUST_RETRY, c, ca, b, NULL,
-                    "bad magic");
+                    "bad magic: want %llx, got %llx",
+                    bset_magic(c), le64_to_cpu(b->data->magic));
 
        btree_err_on(!b->data->keys.seq,
                     BTREE_ERR_MUST_RETRY, c, ca, b, NULL,
-                    "bad btree header");
+                    "bad btree header: seq 0");
 
        if (b->key.k.type == KEY_TYPE_btree_ptr_v2) {
                struct bch_btree_ptr_v2 *bp =