Commit e87b0e4a authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix redundant transaction restart

Little bit of tidying up, this makes the counters a little bit clearer
as to what's happening.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 1bb91233
...@@ -413,14 +413,13 @@ int bch2_trans_relock(struct btree_trans *trans) ...@@ -413,14 +413,13 @@ int bch2_trans_relock(struct btree_trans *trans)
struct btree_path *path; struct btree_path *path;
if (unlikely(trans->restarted)) if (unlikely(trans->restarted))
return -BCH_ERR_transaction_restart_relock; return - ((int) trans->restarted);
trans_for_each_path(trans, path) trans_for_each_path(trans, path)
if (path->should_be_locked && if (path->should_be_locked &&
bch2_btree_path_relock(trans, path, _RET_IP_)) { !bch2_btree_path_relock_norestart(trans, path, _RET_IP_)) {
trace_and_count(trans->c, trans_restart_relock, trans, _RET_IP_, path); trace_and_count(trans->c, trans_restart_relock, trans, _RET_IP_, path);
BUG_ON(!trans->restarted); return btree_trans_restart(trans, BCH_ERR_transaction_restart_relock);
return -BCH_ERR_transaction_restart_relock;
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment