mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 07:59:42 -04:00
bcachefs: Fix btree_iter_next_node() for new locking asserts
We can't unlock a should_be_locked path unless we're in a transaction restart. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -1991,12 +1991,12 @@ struct btree *bch2_btree_iter_next_node(struct btree_trans *trans, struct btree_
|
||||
bch2_btree_path_downgrade(trans, path);
|
||||
|
||||
if (!bch2_btree_node_relock(trans, path, path->level + 1)) {
|
||||
trace_and_count(trans->c, trans_restart_relock_next_node, trans, _THIS_IP_, path);
|
||||
ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_relock);
|
||||
__bch2_btree_path_unlock(trans, path);
|
||||
path->l[path->level].b = ERR_PTR(-BCH_ERR_no_btree_node_relock);
|
||||
path->l[path->level + 1].b = ERR_PTR(-BCH_ERR_no_btree_node_relock);
|
||||
btree_path_set_dirty(trans, path, BTREE_ITER_NEED_TRAVERSE);
|
||||
trace_and_count(trans->c, trans_restart_relock_next_node, trans, _THIS_IP_, path);
|
||||
ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_relock);
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user