mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 18:49:22 -04:00
bcachefs: Fix an iterator bug
We were incorrectly not restarting the transaction when re-traversing iterators. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
6d61724b2b
commit
8666a9ad6f
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user