mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 18:13:26 -04:00
bcachefs: Fix error handling in traverse_all()
In btree_path_traverse_all() we were failing to check for -EIO in the retry loop, and after btree node read error we'd go into an infinite loop. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
committed by
Kent Overstreet
parent
9552e19f6f
commit
a897ef6827
@@ -1468,8 +1468,10 @@ static int bch2_btree_path_traverse_all(struct btree_trans *trans)
|
||||
*/
|
||||
if (path->uptodate) {
|
||||
ret = btree_path_traverse_one(trans, path, 0, _THIS_IP_);
|
||||
if (ret)
|
||||
if (ret == -EINTR || ret == -ENOMEM)
|
||||
goto retry_all;
|
||||
if (ret)
|
||||
goto err;
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
@@ -1482,7 +1484,7 @@ static int bch2_btree_path_traverse_all(struct btree_trans *trans)
|
||||
*/
|
||||
trans_for_each_path(trans, path)
|
||||
BUG_ON(path->uptodate >= BTREE_ITER_NEED_TRAVERSE);
|
||||
|
||||
err:
|
||||
bch2_btree_cache_cannibalize_unlock(c);
|
||||
|
||||
trans->in_traverse_all = false;
|
||||
|
||||
Reference in New Issue
Block a user