summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-10-14 11:47:52 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-10-19 12:39:27 -0400
commit1672644b33c30b7b50bb6aad966e646597f2df94 (patch)
treef8f95fd89d96908dffb04778175320dd07db3eff
parentc8a466386f5c7dfbf0e015a48d1e03868a6289f3 (diff)
bcachefs: Improve bch2_dump_trans_paths_updates()
Also print the key beyng overwritten for each update. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/btree_iter.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 18d2733e6a65..14fb1ad89517 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1688,7 +1688,7 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans)
struct btree_path *path;
struct btree_insert_entry *i;
unsigned idx;
- char buf[300];
+ char buf1[300], buf2[300];
btree_trans_verify_sorted(trans);
@@ -1697,7 +1697,7 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans)
path->idx, path->ref, path->intent_ref,
path->preserve ? " preserve" : "",
bch2_btree_ids[path->btree_id],
- (bch2_bpos_to_text(&PBUF(buf), path->pos), buf),
+ (bch2_bpos_to_text(&PBUF(buf1), path->pos), buf1),
#ifdef CONFIG_BCACHEFS_DEBUG
(void *) path->ip_allocated
#else
@@ -1705,11 +1705,16 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans)
#endif
);
- trans_for_each_update(trans, i)
- printk(KERN_ERR "update: btree %s %s %pS\n",
+ trans_for_each_update(trans, i) {
+ struct bkey u;
+ struct bkey_s_c old = bch2_btree_path_peek_slot(i->path, &u);
+
+ printk(KERN_ERR "update: btree %s %pS\n old %s\n new %s",
bch2_btree_ids[i->btree_id],
- (bch2_bkey_val_to_text(&PBUF(buf), trans->c, bkey_i_to_s_c(i->k)), buf),
- (void *) i->ip_allocated);
+ (void *) i->ip_allocated,
+ (bch2_bkey_val_to_text(&PBUF(buf1), trans->c, old), buf1),
+ (bch2_bkey_val_to_text(&PBUF(buf2), trans->c, bkey_i_to_s_c(i->k)), buf2));
+ }
}
static struct btree_path *btree_path_alloc(struct btree_trans *trans,