Commit a2b6b072 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: add missing bch2_btree_iter_node_drop() call

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 58a46dc5
......@@ -819,14 +819,6 @@ void bch2_btree_iter_node_drop(struct btree_iter *iter, struct btree *b)
struct btree_iter *linked;
unsigned level = b->level;
/* caller now responsible for unlocking @b */
BUG_ON(iter->l[level].b != b);
BUG_ON(!btree_node_intent_locked(iter, level));
iter->l[level].b = BTREE_ITER_NOT_END;
mark_btree_node_unlocked(iter, level);
trans_for_each_iter(iter->trans, linked)
if (linked->l[level].b == b) {
__btree_node_unlock(linked, level);
......
......@@ -1429,6 +1429,7 @@ static void btree_split(struct btree_update *as, struct btree *b,
/* Successful split, update the iterator to point to the new nodes: */
six_lock_increment(&b->lock, SIX_LOCK_intent);
bch2_btree_iter_node_drop(iter, b);
if (n3)
bch2_btree_iter_node_replace(iter, n3);
......@@ -1740,7 +1741,10 @@ void __bch2_foreground_maybe_merge(struct bch_fs *c,
bch2_open_buckets_put(c, &n->ob);
six_lock_increment(&b->lock, SIX_LOCK_intent);
bch2_btree_iter_node_drop(iter, b);
bch2_btree_iter_node_drop(iter, m);
bch2_btree_iter_node_replace(iter, n);
bch2_btree_iter_verify(iter, n);
......@@ -1838,6 +1842,7 @@ static int __btree_node_rewrite(struct bch_fs *c, struct btree_iter *iter,
bch2_open_buckets_put(c, &n->ob);
six_lock_increment(&b->lock, SIX_LOCK_intent);
bch2_btree_iter_node_drop(iter, b);
bch2_btree_iter_node_replace(iter, n);
bch2_btree_node_free_inmem(c, b, iter);
......
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