diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-28 23:11:36 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:55 -0400 |
commit | 8f2bbcdd9bc8f9c0a2d4b6801d1dfeb20e28e954 (patch) | |
tree | 0dc05cf25c95d4fb19941575822349bdcd9327af /fs/bcachefs/ec.c | |
parent | 2f4e9472fa67ff528973f71729175c4c715b1912 (diff) | |
download | lwn-8f2bbcdd9bc8f9c0a2d4b6801d1dfeb20e28e954.tar.gz lwn-8f2bbcdd9bc8f9c0a2d4b6801d1dfeb20e28e954.zip |
bcachefs: ec: Improve error message for btree node in stripe
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index cb291b2a4dd8..88c4873e1833 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -898,8 +898,21 @@ static int ec_stripe_update_extent(struct btree_trans *trans, if (*bp_offset == U64_MAX) return 0; - if (bch2_fs_inconsistent_on(bp.level, c, "found btree node in erasure coded bucket!?")) + if (bp.level) { + struct printbuf buf = PRINTBUF; + struct btree_iter node_iter; + struct btree *b; + + b = bch2_backpointer_get_node(trans, &node_iter, bucket, *bp_offset, bp); + bch2_trans_iter_exit(trans, &node_iter); + + prt_printf(&buf, "found btree node in erasure coded bucket: b=%px\n", b); + bch2_backpointer_to_text(&buf, &bp); + + bch2_fs_inconsistent(c, "%s", buf.buf); + printbuf_exit(&buf); return -EIO; + } k = bch2_backpointer_get_key(trans, &iter, bucket, *bp_offset, bp); ret = bkey_err(k); |