Commit 8666a9ad authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix an iterator bug

We were incorrectly not restarting the transaction when re-traversing
iterators.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 6d61724b
......@@ -1068,7 +1068,14 @@ static int __btree_iter_traverse_all(struct btree_trans *trans,
goto retry_all;
}
ret = hweight64(trans->iters_live) > 1 ? -EINTR : 0;
if (hweight64(trans->iters_live) > 1)
ret = -EINTR;
else
trans_for_each_iter(trans, iter)
if (iter->flags & BTREE_ITER_KEEP_UNTIL_COMMIT) {
ret = -EINTR;
break;
}
out:
bch2_btree_cache_cannibalize_unlock(c);
return ret;
......
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