diff options
author | Dan Robertson <dan@dlrobertson.com> | 2021-06-29 18:52:13 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:07 -0400 |
commit | 32abe2e38f5da39a79561b8e42f22062171c798d (patch) | |
tree | 5820bab6f63a73adb0427e4c316bf4409dfa23c1 /fs/bcachefs/migrate.c | |
parent | 729608a606fdef3dc97762081442d7b4a40d16a4 (diff) | |
download | linux-stable-32abe2e38f5da39a79561b8e42f22062171c798d.tar.gz linux-stable-32abe2e38f5da39a79561b8e42f22062171c798d.tar.bz2 linux-stable-32abe2e38f5da39a79561b8e42f22062171c798d.zip |
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.c | 3 |
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); |