Loading fs/bcachefs/alloc_background.c +3 −3 Original line number Diff line number Diff line Loading @@ -727,7 +727,7 @@ static int bch2_bucket_do_index(struct btree_trans *trans, "incorrect key when %s %s:%llu:%llu:0 (got %s should be %s)\n" " for %s", set ? "setting" : "clearing", bch2_btree_ids[btree], bch2_btree_id_str(btree), iter.pos.inode, iter.pos.offset, bch2_bkey_types[old.k->type], Loading Loading @@ -1245,7 +1245,7 @@ static noinline_for_stack int __bch2_check_discard_freespace_key(struct btree_tr if (fsck_err_on(!bch2_dev_bucket_exists(c, pos), c, "entry in %s btree for nonexistant dev:bucket %llu:%llu", bch2_btree_ids[iter->btree_id], pos.inode, pos.offset)) bch2_btree_id_str(iter->btree_id), pos.inode, pos.offset)) goto delete; a = bch2_alloc_to_v4(alloc_k, &a_convert); Loading @@ -1255,7 +1255,7 @@ static noinline_for_stack int __bch2_check_discard_freespace_key(struct btree_tr genbits != alloc_freespace_genbits(*a)), c, "%s\n incorrectly set at %s:%llu:%llu:0 (free %u, genbits %llu should be %llu)", (bch2_bkey_val_to_text(&buf, c, alloc_k), buf.buf), bch2_btree_ids[iter->btree_id], bch2_btree_id_str(iter->btree_id), iter->pos.inode, iter->pos.offset, a->data_type == state, Loading fs/bcachefs/backpointers.c +2 −2 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ int bch2_backpointer_invalid(const struct bch_fs *c, struct bkey_s_c k, void bch2_backpointer_to_text(struct printbuf *out, const struct bch_backpointer *bp) { prt_printf(out, "btree=%s l=%u offset=%llu:%u len=%u pos=", bch2_btree_ids[bp->btree_id], bch2_btree_id_str(bp->btree_id), bp->level, (u64) (bp->bucket_offset >> MAX_EXTENT_COMPRESS_RATIO_SHIFT), (u32) bp->bucket_offset & ~(~0U << MAX_EXTENT_COMPRESS_RATIO_SHIFT), Loading Loading @@ -453,7 +453,7 @@ static int check_bp_exists(struct btree_trans *trans, return ret; missing: prt_printf(&buf, "missing backpointer for btree=%s l=%u ", bch2_btree_ids[bp.btree_id], bp.level); bch2_btree_id_str(bp.btree_id), bp.level); bch2_bkey_val_to_text(&buf, c, orig_k); prt_printf(&buf, "\nbp pos "); bch2_bpos_to_text(&buf, bp_iter.pos); Loading fs/bcachefs/bbpos.h +2 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ #define _BCACHEFS_BBPOS_H #include "bkey_methods.h" #include "btree_cache.h" struct bbpos { enum btree_id btree; Loading Loading @@ -40,7 +41,7 @@ static inline struct bbpos bbpos_successor(struct bbpos pos) static inline void bch2_bbpos_to_text(struct printbuf *out, struct bbpos pos) { prt_str(out, bch2_btree_ids[pos.btree]); prt_str(out, bch2_btree_id_str(pos.btree)); prt_char(out, ':'); bch2_bpos_to_text(out, pos.pos); } Loading fs/bcachefs/bkey_methods.c +2 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ #include "bcachefs.h" #include "backpointers.h" #include "bkey_methods.h" #include "btree_cache.h" #include "btree_types.h" #include "alloc_background.h" #include "dirent.h" Loading Loading @@ -164,7 +165,7 @@ int __bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k, if (flags & BKEY_INVALID_COMMIT && !(bch2_key_types_allowed[type] & BIT_ULL(k.k->type))) { prt_printf(err, "invalid key type for btree %s (%s)", bch2_btree_ids[type], bch2_bkey_types[k.k->type]); bch2_btree_id_str(type), bch2_bkey_types[k.k->type]); return -BCH_ERR_invalid_bkey; } Loading fs/bcachefs/btree_cache.c +17 −4 Original line number Diff line number Diff line Loading @@ -783,12 +783,12 @@ static noinline void btree_bad_header(struct bch_fs *c, struct btree *b) "btree node header doesn't match ptr\n" "btree %s level %u\n" "ptr: ", bch2_btree_ids[b->c.btree_id], b->c.level); bch2_btree_id_str(b->c.btree_id), b->c.level); bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(&b->key)); prt_printf(&buf, "\nheader: btree %s level %llu\n" "min ", bch2_btree_ids[BTREE_NODE_ID(b->data)], bch2_btree_id_str(BTREE_NODE_ID(b->data)), BTREE_NODE_LEVEL(b->data)); bch2_bpos_to_text(&buf, b->data->min_key); Loading Loading @@ -1151,8 +1151,21 @@ void bch2_btree_node_evict(struct btree_trans *trans, const struct bkey_i *k) six_unlock_intent(&b->c.lock); } void bch2_btree_node_to_text(struct printbuf *out, struct bch_fs *c, const struct btree *b) const char *bch2_btree_id_str(enum btree_id btree) { return btree < BTREE_ID_NR ? __bch2_btree_ids[btree] : "(unknown)"; } void bch2_btree_pos_to_text(struct printbuf *out, struct bch_fs *c, const struct btree *b) { prt_printf(out, "%s level %u/%u\n ", bch2_btree_id_str(b->c.btree_id), b->c.level, bch2_btree_id_root(c, b->c.btree_id)->level); bch2_bkey_val_to_text(out, c, bkey_i_to_s_c(&b->key)); } void bch2_btree_node_to_text(struct printbuf *out, struct bch_fs *c, const struct btree *b) { struct bset_stats stats; Loading Loading
fs/bcachefs/alloc_background.c +3 −3 Original line number Diff line number Diff line Loading @@ -727,7 +727,7 @@ static int bch2_bucket_do_index(struct btree_trans *trans, "incorrect key when %s %s:%llu:%llu:0 (got %s should be %s)\n" " for %s", set ? "setting" : "clearing", bch2_btree_ids[btree], bch2_btree_id_str(btree), iter.pos.inode, iter.pos.offset, bch2_bkey_types[old.k->type], Loading Loading @@ -1245,7 +1245,7 @@ static noinline_for_stack int __bch2_check_discard_freespace_key(struct btree_tr if (fsck_err_on(!bch2_dev_bucket_exists(c, pos), c, "entry in %s btree for nonexistant dev:bucket %llu:%llu", bch2_btree_ids[iter->btree_id], pos.inode, pos.offset)) bch2_btree_id_str(iter->btree_id), pos.inode, pos.offset)) goto delete; a = bch2_alloc_to_v4(alloc_k, &a_convert); Loading @@ -1255,7 +1255,7 @@ static noinline_for_stack int __bch2_check_discard_freespace_key(struct btree_tr genbits != alloc_freespace_genbits(*a)), c, "%s\n incorrectly set at %s:%llu:%llu:0 (free %u, genbits %llu should be %llu)", (bch2_bkey_val_to_text(&buf, c, alloc_k), buf.buf), bch2_btree_ids[iter->btree_id], bch2_btree_id_str(iter->btree_id), iter->pos.inode, iter->pos.offset, a->data_type == state, Loading
fs/bcachefs/backpointers.c +2 −2 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ int bch2_backpointer_invalid(const struct bch_fs *c, struct bkey_s_c k, void bch2_backpointer_to_text(struct printbuf *out, const struct bch_backpointer *bp) { prt_printf(out, "btree=%s l=%u offset=%llu:%u len=%u pos=", bch2_btree_ids[bp->btree_id], bch2_btree_id_str(bp->btree_id), bp->level, (u64) (bp->bucket_offset >> MAX_EXTENT_COMPRESS_RATIO_SHIFT), (u32) bp->bucket_offset & ~(~0U << MAX_EXTENT_COMPRESS_RATIO_SHIFT), Loading Loading @@ -453,7 +453,7 @@ static int check_bp_exists(struct btree_trans *trans, return ret; missing: prt_printf(&buf, "missing backpointer for btree=%s l=%u ", bch2_btree_ids[bp.btree_id], bp.level); bch2_btree_id_str(bp.btree_id), bp.level); bch2_bkey_val_to_text(&buf, c, orig_k); prt_printf(&buf, "\nbp pos "); bch2_bpos_to_text(&buf, bp_iter.pos); Loading
fs/bcachefs/bbpos.h +2 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ #define _BCACHEFS_BBPOS_H #include "bkey_methods.h" #include "btree_cache.h" struct bbpos { enum btree_id btree; Loading Loading @@ -40,7 +41,7 @@ static inline struct bbpos bbpos_successor(struct bbpos pos) static inline void bch2_bbpos_to_text(struct printbuf *out, struct bbpos pos) { prt_str(out, bch2_btree_ids[pos.btree]); prt_str(out, bch2_btree_id_str(pos.btree)); prt_char(out, ':'); bch2_bpos_to_text(out, pos.pos); } Loading
fs/bcachefs/bkey_methods.c +2 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ #include "bcachefs.h" #include "backpointers.h" #include "bkey_methods.h" #include "btree_cache.h" #include "btree_types.h" #include "alloc_background.h" #include "dirent.h" Loading Loading @@ -164,7 +165,7 @@ int __bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k, if (flags & BKEY_INVALID_COMMIT && !(bch2_key_types_allowed[type] & BIT_ULL(k.k->type))) { prt_printf(err, "invalid key type for btree %s (%s)", bch2_btree_ids[type], bch2_bkey_types[k.k->type]); bch2_btree_id_str(type), bch2_bkey_types[k.k->type]); return -BCH_ERR_invalid_bkey; } Loading
fs/bcachefs/btree_cache.c +17 −4 Original line number Diff line number Diff line Loading @@ -783,12 +783,12 @@ static noinline void btree_bad_header(struct bch_fs *c, struct btree *b) "btree node header doesn't match ptr\n" "btree %s level %u\n" "ptr: ", bch2_btree_ids[b->c.btree_id], b->c.level); bch2_btree_id_str(b->c.btree_id), b->c.level); bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(&b->key)); prt_printf(&buf, "\nheader: btree %s level %llu\n" "min ", bch2_btree_ids[BTREE_NODE_ID(b->data)], bch2_btree_id_str(BTREE_NODE_ID(b->data)), BTREE_NODE_LEVEL(b->data)); bch2_bpos_to_text(&buf, b->data->min_key); Loading Loading @@ -1151,8 +1151,21 @@ void bch2_btree_node_evict(struct btree_trans *trans, const struct bkey_i *k) six_unlock_intent(&b->c.lock); } void bch2_btree_node_to_text(struct printbuf *out, struct bch_fs *c, const struct btree *b) const char *bch2_btree_id_str(enum btree_id btree) { return btree < BTREE_ID_NR ? __bch2_btree_ids[btree] : "(unknown)"; } void bch2_btree_pos_to_text(struct printbuf *out, struct bch_fs *c, const struct btree *b) { prt_printf(out, "%s level %u/%u\n ", bch2_btree_id_str(b->c.btree_id), b->c.level, bch2_btree_id_root(c, b->c.btree_id)->level); bch2_bkey_val_to_text(out, c, bkey_i_to_s_c(&b->key)); } void bch2_btree_node_to_text(struct printbuf *out, struct bch_fs *c, const struct btree *b) { struct bset_stats stats; Loading