Skip to content

Commit 3f2f028

Browse files
author
Kent Overstreet
committed
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 <[email protected]>
1 parent 521f958 commit 3f2f028

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/bcachefs/btree_iter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,12 +1991,12 @@ struct btree *bch2_btree_iter_next_node(struct btree_trans *trans, struct btree_
19911991
bch2_btree_path_downgrade(trans, path);
19921992

19931993
if (!bch2_btree_node_relock(trans, path, path->level + 1)) {
1994+
trace_and_count(trans->c, trans_restart_relock_next_node, trans, _THIS_IP_, path);
1995+
ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_relock);
19941996
__bch2_btree_path_unlock(trans, path);
19951997
path->l[path->level].b = ERR_PTR(-BCH_ERR_no_btree_node_relock);
19961998
path->l[path->level + 1].b = ERR_PTR(-BCH_ERR_no_btree_node_relock);
19971999
btree_path_set_dirty(trans, path, BTREE_ITER_NEED_TRAVERSE);
1998-
trace_and_count(trans->c, trans_restart_relock_next_node, trans, _THIS_IP_, path);
1999-
ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_relock);
20002000
goto err;
20012001
}
20022002

0 commit comments

Comments
 (0)