Commit 483dea44 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Improve error message when finding wrong btree node

single_device.merge_torture_flakey is, very rarely, finding a btree node
that doesn't match the key that points to it: this patch improves the
error message to print out more fields from the btree node header, so
that we can see what else does or does not match the key.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 5a11b5fe
...@@ -968,12 +968,20 @@ int bch2_btree_node_read_done(struct bch_fs *c, struct bch_dev *ca, ...@@ -968,12 +968,20 @@ int bch2_btree_node_read_done(struct bch_fs *c, struct bch_dev *ca,
struct bch_btree_ptr_v2 *bp = struct bch_btree_ptr_v2 *bp =
&bkey_i_to_btree_ptr_v2(&b->key)->v; &bkey_i_to_btree_ptr_v2(&b->key)->v;
bch2_bpos_to_text(&buf, b->data->min_key);
prt_str(&buf, "-");
bch2_bpos_to_text(&buf, b->data->max_key);
btree_err_on(b->data->keys.seq != bp->seq, btree_err_on(b->data->keys.seq != bp->seq,
-BCH_ERR_btree_node_read_err_must_retry, -BCH_ERR_btree_node_read_err_must_retry,
c, ca, b, NULL, c, ca, b, NULL,
btree_node_bad_seq, btree_node_bad_seq,
"got wrong btree node (seq %llx want %llx)", "got wrong btree node (want %llx got %llx)\n"
b->data->keys.seq, bp->seq); "got btree %s level %llu pos %s",
bp->seq, b->data->keys.seq,
bch2_btree_id_str(BTREE_NODE_ID(b->data)),
BTREE_NODE_LEVEL(b->data),
buf.buf);
} else { } else {
btree_err_on(!b->data->keys.seq, btree_err_on(!b->data->keys.seq,
-BCH_ERR_btree_node_read_err_must_retry, -BCH_ERR_btree_node_read_err_must_retry,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment