diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-09-04 08:28:51 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:40 +0300 |
commit | e87b0e4a7120eeca1850666351b75bf8ceb9d5c9 (patch) | |
tree | ced7bf9cd8ae26e6b500bf1ca506e2505ed64d42 /fs/bcachefs/btree_locking.c | |
parent | 1bb9123301834fbeb81de9e52181ba71b06a011a (diff) | |
download | linux-e87b0e4a7120eeca1850666351b75bf8ceb9d5c9.tar.xz |
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: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_locking.c')
-rw-r--r-- | fs/bcachefs/btree_locking.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/bcachefs/btree_locking.c b/fs/bcachefs/btree_locking.c index bfe9780aea3a..08dbc799bb35 100644 --- a/fs/bcachefs/btree_locking.c +++ b/fs/bcachefs/btree_locking.c @@ -413,14 +413,13 @@ int bch2_trans_relock(struct btree_trans *trans) struct btree_path *path; if (unlikely(trans->restarted)) - return -BCH_ERR_transaction_restart_relock; + return - ((int) trans->restarted); trans_for_each_path(trans, path) 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); - BUG_ON(!trans->restarted); - return -BCH_ERR_transaction_restart_relock; + return btree_trans_restart(trans, BCH_ERR_transaction_restart_relock); } return 0; } |