diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-18 23:43:08 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-21 13:23:49 -0400 |
commit | 888d125fc3be6e3d66a64dbc8132072779b5a37e (patch) | |
tree | ce6dfc79bb145e89462cbe567635a209578641d2 | |
parent | a6ef096322b14b945b41388372a39e888c16d284 (diff) |
bcachefs: Improve invalid bkey error message
Bkeys have gotten a lot bigger since this code was written and now are
often formatted across multiple lines - while the reason a bkey is
invalid will still be short and fit on a single line. This patch prints
the error bfore the bkey, making it a bit more readable.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | fs/bcachefs/btree_io.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c index 5d0aaf0d8752..7a883922bb09 100644 --- a/fs/bcachefs/btree_io.c +++ b/fs/bcachefs/btree_io.c @@ -820,10 +820,10 @@ static int validate_bset_keys(struct bch_fs *c, struct btree *b, printbuf_reset(&buf); if (bset_key_invalid(c, b, u.s_c, updated_range, write, &buf)) { printbuf_reset(&buf); - pr_buf(&buf, "invalid bkey:\n "); - bch2_bkey_val_to_text(&buf, c, u.s_c); - pr_buf(&buf, " \n"); + pr_buf(&buf, "invalid bkey: "); bset_key_invalid(c, b, u.s_c, updated_range, write, &buf); + pr_buf(&buf, "\n "); + bch2_bkey_val_to_text(&buf, c, u.s_c); btree_err(BTREE_ERR_FIXABLE, c, NULL, b, i, "%s", buf.buf); @@ -1081,10 +1081,10 @@ int bch2_btree_node_read_done(struct bch_fs *c, struct bch_dev *ca, !bversion_cmp(u.k->version, MAX_VERSION))) { printbuf_reset(&buf); - pr_buf(&buf, "invalid bkey\n "); - bch2_bkey_val_to_text(&buf, c, u.s_c); - pr_buf(&buf, "\n "); + pr_buf(&buf, "invalid bkey: "); bch2_bkey_val_invalid(c, u.s_c, READ, &buf); + pr_buf(&buf, "\n "); + bch2_bkey_val_to_text(&buf, c, u.s_c); btree_err(BTREE_ERR_FIXABLE, c, NULL, b, i, "%s", buf.buf); |