summaryrefslogtreecommitdiff
path: root/fs/bcachefs/migrate.c
diff options
context:
space:
mode:
authorDan Robertson <dan@dlrobertson.com>2021-06-30 01:52:13 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:07 +0300
commit32abe2e38f5da39a79561b8e42f22062171c798d (patch)
tree5820bab6f63a73adb0427e4c316bf4409dfa23c1 /fs/bcachefs/migrate.c
parent729608a606fdef3dc97762081442d7b4a40d16a4 (diff)
downloadlinux-32abe2e38f5da39a79561b8e42f22062171c798d.tar.xz
bcachefs: ensure iter->should_be_locked is set
Ensure that iter->should_be_locked is set to true before we call bch2_trans_update in __bch2_dev_usrdata_drop. Signed-off-by: Dan Robertson <dan@dlrobertson.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/migrate.c')
-rw-r--r--fs/bcachefs/migrate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/migrate.c b/fs/bcachefs/migrate.c
index 6ebe49ba2248..91a9f584dd6d 100644
--- a/fs/bcachefs/migrate.c
+++ b/fs/bcachefs/migrate.c
@@ -73,7 +73,8 @@ static int __bch2_dev_usrdata_drop(struct bch_fs *c, unsigned dev_idx, int flags
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);