Commit 33eb63e5 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a bug with multiple iterators being traversed

If upgrade fails on one iterator, but it was copied from another
iterator and will be freed before transaction restart, then the original
iterator will get traversed first, so we need to make required btree
nodes on the original iterator will be traversed too.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 1fe93f88
...@@ -320,7 +320,6 @@ bool __bch2_btree_iter_upgrade(struct btree_iter *iter, ...@@ -320,7 +320,6 @@ bool __bch2_btree_iter_upgrade(struct btree_iter *iter,
trans_for_each_iter(iter->trans, linked) trans_for_each_iter(iter->trans, linked)
if (linked != iter && if (linked != iter &&
linked->btree_id == iter->btree_id && linked->btree_id == iter->btree_id &&
btree_iter_cmp(linked, iter) <= 0 &&
linked->locks_want < new_locks_want) { linked->locks_want < new_locks_want) {
linked->locks_want = new_locks_want; linked->locks_want = new_locks_want;
btree_iter_get_locks(linked, true); btree_iter_get_locks(linked, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment