Commit f2d9823f authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: maintain lock invariants in btree_iter_next_node()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 449ceafb
...@@ -1902,6 +1902,9 @@ struct btree *bch2_btree_iter_next_node(struct btree_iter *iter) ...@@ -1902,6 +1902,9 @@ struct btree *bch2_btree_iter_next_node(struct btree_iter *iter)
if (bpos_eq(iter->pos, b->key.k.p)) { if (bpos_eq(iter->pos, b->key.k.p)) {
__btree_path_set_level_up(trans, path, path->level++); __btree_path_set_level_up(trans, path, path->level++);
} else { } else {
if (btree_lock_want(path, path->level + 1) == BTREE_NODE_UNLOCKED)
btree_node_unlock(trans, path, path->level + 1);
/* /*
* Haven't gotten to the end of the parent node: go back down to * Haven't gotten to the end of the parent node: go back down to
* the next child node * the next child node
......
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