diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-12 01:04:00 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-09 00:29:19 +0300 |
commit | f2d9823f46b4aebbe2d6a7f1a76158536c6291a8 (patch) | |
tree | 4fafdb9708afa4936258bd5f46b7940932158923 | |
parent | 449ceafb49e43012a76ac26a2c12aa94bdb50176 (diff) | |
download | linux-f2d9823f46b4aebbe2d6a7f1a76158536c6291a8.tar.xz |
bcachefs: maintain lock invariants in btree_iter_next_node()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/btree_iter.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index e08167e3559d..bb037e4da299 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1902,6 +1902,9 @@ struct btree *bch2_btree_iter_next_node(struct btree_iter *iter) if (bpos_eq(iter->pos, b->key.k.p)) { __btree_path_set_level_up(trans, path, path->level++); } 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 * the next child node |