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;
}
{
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
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;
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;
}