Commit ab9ff733 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix an error path

It's possible to get -EIO in __btree_iter_traverse_all() after looping,
with orig_iter NULL.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 8de819f8
......@@ -1010,8 +1010,11 @@ static int __btree_iter_traverse_all(struct btree_trans *trans,
if (unlikely(ret == -EIO)) {
trans->error = true;
orig_iter->flags |= BTREE_ITER_ERROR;
orig_iter->l[orig_iter->level].b = BTREE_ITER_NO_NODE_ERROR;
if (orig_iter) {
orig_iter->flags |= BTREE_ITER_ERROR;
orig_iter->l[orig_iter->level].b =
BTREE_ITER_NO_NODE_ERROR;
}
goto out;
}
......
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