diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-03-29 21:42:34 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:19 +0300 |
commit | a2b6b0729e8b4d06d1cf1baf1a7976b54c872aeb (patch) | |
tree | b4ad24bb341996ff7d5f096b0d7b77a29f25bdaa | |
parent | 58a46dc5a2d4073f48a9110a9c343bc2d68a6e88 (diff) | |
download | linux-a2b6b0729e8b4d06d1cf1baf1a7976b54c872aeb.tar.xz |
bcachefs: add missing bch2_btree_iter_node_drop() call
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/btree_iter.c | 8 | ||||
-rw-r--r-- | fs/bcachefs/btree_update_interior.c | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index bc9d8444e220..bb898911bdc6 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -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); diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index 6e9a87c6b1be..4931089e2c6d 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -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 @@ retry: 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); |