bcachefs: ensure iter->should_be_locked is set
authorDan Robertson <dan@dlrobertson.com>
Thu, 17 Jun 2021 03:21:23 +0000 (23:21 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:07 +0000 (17:09 -0400)
Ensure that iter->should_be_locked value is set to true before we
call bch2_trans_update in ec_stripe_update_ptrs.

Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/ec.c

index 7cc7ca94b08282237dd4cb9aa36970d6095c241f..c0855245f2ec4127fc1e735b01074d6154d5adfd 100644 (file)
@@ -863,7 +863,8 @@ static int ec_stripe_update_ptrs(struct bch_fs *c,
                extent_stripe_ptr_add(e, s, ec_ptr, block);
 
                bch2_btree_iter_set_pos(iter, bkey_start_pos(&sk.k->k));
-               ret   = bch2_trans_update(&trans, iter, sk.k, 0) ?:
+               ret   = bch2_btree_iter_traverse(iter) ?:
+                       bch2_trans_update(&trans, iter, sk.k, 0) ?:
                        bch2_trans_commit(&trans, NULL, NULL,
                                        BTREE_INSERT_NOFAIL);
                if (ret == -EINTR)