bcachefs: Always clear should_be_locked in bch2_trans_begin()

bch2_trans_begin() invalidates all iterators, until they're revalidated
by calling peek() or traverse().

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-02-24 13:27:31 -05:00 committed by Kent Overstreet
parent 0c10cf8525
commit 25a7723182

View File

@ -2988,6 +2988,8 @@ void bch2_trans_begin(struct btree_trans *trans)
}
trans_for_each_path(trans, path) {
path->should_be_locked = false;
/*
* XXX: we probably shouldn't be doing this if the transaction
* was restarted, but currently we still overflow transaction
@ -2996,7 +2998,7 @@ void bch2_trans_begin(struct btree_trans *trans)
if (!path->ref && !path->preserve)
__bch2_path_free(trans, path);
else
path->preserve = path->should_be_locked = false;
path->preserve = false;
}
bch2_trans_cond_resched(trans);