diff options
-rw-r--r-- | fs/bcachefs/btree_cache.c | 25 | ||||
-rw-r--r-- | fs/bcachefs/extents.c | 5 |
2 files changed, 15 insertions, 15 deletions
diff --git a/fs/bcachefs/btree_cache.c b/fs/bcachefs/btree_cache.c index 19afbdcae5e4..e2c02ae98f83 100644 --- a/fs/bcachefs/btree_cache.c +++ b/fs/bcachefs/btree_cache.c @@ -719,26 +719,25 @@ static int lock_node_check_fn(struct six_lock *lock, void *p) static noinline void btree_bad_header(struct bch_fs *c, struct btree *b) { - char buf1[100], buf2[100], buf3[100], buf4[100]; + char buf1[200], buf2[100], buf3[100]; if (!test_bit(BCH_FS_INITIAL_GC_DONE, &c->flags)) return; - bch2_bpos_to_text(&PBUF(buf1), b->key.k.type == KEY_TYPE_btree_ptr_v2 - ? bkey_i_to_btree_ptr_v2(&b->key)->v.min_key - : POS_MIN); + bch2_bkey_val_to_text(&PBUF(buf1), c, bkey_i_to_s_c(&b->key)); bch2_bpos_to_text(&PBUF(buf2), b->data->min_key); + bch2_bpos_to_text(&PBUF(buf3), b->data->max_key); - bch2_bpos_to_text(&PBUF(buf3), b->key.k.p); - bch2_bpos_to_text(&PBUF(buf4), b->data->max_key); bch2_fs_inconsistent(c, "btree node header doesn't match ptr\n" - "btree: ptr %u header %llu\n" - "level: ptr %u header %llu\n" - "min ptr %s node header %s\n" - "max ptr %s node header %s", - b->c.btree_id, BTREE_NODE_ID(b->data), - b->c.level, BTREE_NODE_LEVEL(b->data), - buf1, buf2, buf3, buf4); + "btree %s level %u\n" + "ptr: %s\n" + "header: btree %s level %llu\n" + "min %s max %s\n", + bch2_btree_ids[b->c.btree_id], b->c.level, + buf1, + bch2_btree_ids[BTREE_NODE_ID(b->data)], + BTREE_NODE_LEVEL(b->data), + buf2, buf3); } static inline void btree_check_header(struct bch_fs *c, struct btree *b) diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c index c7643e6c8816..6524703f3da4 100644 --- a/fs/bcachefs/extents.c +++ b/fs/bcachefs/extents.c @@ -191,9 +191,10 @@ void bch2_btree_ptr_v2_to_text(struct printbuf *out, struct bch_fs *c, { struct bkey_s_c_btree_ptr_v2 bp = bkey_s_c_to_btree_ptr_v2(k); - pr_buf(out, "seq %llx written %u min_key ", + pr_buf(out, "seq %llx written %u min_key %s", le64_to_cpu(bp.v->seq), - le16_to_cpu(bp.v->sectors_written)); + le16_to_cpu(bp.v->sectors_written), + BTREE_PTR_RANGE_UPDATED(bp.v) ? "R " : ""); bch2_bpos_to_text(out, bp.v->min_key); pr_buf(out, " "); |