diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-13 15:51:27 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-13 15:51:27 -0500 |
commit | 1b2d60826974e31b9894b6d5aa59b0e7e62823cd (patch) | |
tree | b0843bde9b859eab87520b88f7ddb8a4ccfe6cb8 /libbcachefs/btree_iter.c | |
parent | 4697efb7a01affe650dbc9a4e81a8203d0316d96 (diff) |
Update bcachefs sources to 8dbfede1d9 fixup! bcachefs: More info on check_bucket_ref() error
Diffstat (limited to 'libbcachefs/btree_iter.c')
-rw-r--r-- | libbcachefs/btree_iter.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/libbcachefs/btree_iter.c b/libbcachefs/btree_iter.c index dc2b2a08..3977bb1f 100644 --- a/libbcachefs/btree_iter.c +++ b/libbcachefs/btree_iter.c @@ -1174,10 +1174,17 @@ int bch2_btree_path_traverse_one(struct btree_trans *trans, path->uptodate = BTREE_ITER_UPTODATE; out: - if (bch2_err_matches(ret, BCH_ERR_transaction_restart) != !!trans->restarted) - panic("ret %s (%i) trans->restarted %s (%i)\n", - bch2_err_str(ret), ret, - bch2_err_str(trans->restarted), trans->restarted); + if (bch2_err_matches(ret, BCH_ERR_transaction_restart) != !!trans->restarted) { + struct printbuf buf = PRINTBUF; + + prt_printf(&buf, "ret %s (%i) trans->restarted %s (%i)\n", + bch2_err_str(ret), ret, + bch2_err_str(trans->restarted), trans->restarted); +#ifdef CONFIG_BCACHEFS_DEBUG + bch2_prt_backtrace(&buf, &trans->last_restarted); +#endif + panic("%s", buf.buf); + } bch2_btree_path_verify(trans, path); return ret; } @@ -1360,14 +1367,14 @@ void bch2_trans_restart_error(struct btree_trans *trans, u32 restart_count) { panic("trans->restart_count %u, should be %u, last restarted by %pS\n", trans->restart_count, restart_count, - (void *) trans->last_restarted_ip); + (void *) trans->last_begin_ip); } void bch2_trans_in_restart_error(struct btree_trans *trans) { panic("in transaction restart: %s, last restarted by %pS\n", bch2_err_str(trans->restarted), - (void *) trans->last_restarted_ip); + (void *) trans->last_begin_ip); } noinline __cold @@ -2865,7 +2872,7 @@ u32 bch2_trans_begin(struct btree_trans *trans) if (unlikely(time_after(jiffies, trans->srcu_lock_time + msecs_to_jiffies(10)))) bch2_trans_reset_srcu_lock(trans); - trans->last_restarted_ip = _RET_IP_; + trans->last_begin_ip = _RET_IP_; if (trans->restarted) { bch2_btree_path_traverse_all(trans); trans->notrace_relock_fail = false; @@ -3046,6 +3053,10 @@ void bch2_trans_exit(struct btree_trans *trans) if (trans->paths) mempool_free(trans->paths, &c->btree_paths_pool); +#ifdef CONFIG_BCACHEFS_DEBUG + darray_exit(&trans->last_restarted); +#endif + trans->mem = (void *) 0x1; trans->paths = (void *) 0x1; } |