bcachefs: Improve an error message
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 1 Sep 2021 22:06:01 +0000 (18:06 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:11 +0000 (17:09 -0400)
When we detect an invalid key being inserted, we should print what code
was doing the update.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_update_leaf.c

index 3a59f10..5e57ff5 100644 (file)
@@ -577,7 +577,9 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans,
                        char buf[200];
 
                        bch2_bkey_val_to_text(&PBUF(buf), c, bkey_i_to_s_c(i->k));
-                       bch_err(c, "invalid bkey %s on insert: %s\n", buf, invalid);
+                       bch_err(c, "invalid bkey %s on insert from %ps -> %ps: %s\n",
+                               buf, (void *) trans->ip,
+                               (void *) i->ip_allocated, invalid);
                        bch2_fatal_error(c);
                }
                btree_insert_entry_checks(trans, i);