summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-05-24 14:33:16 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2019-06-10 14:08:07 -0400
commitcef5c75e273027ec4211fc9ba079aae61d49724e (patch)
treea48394918e5a68e4e92af666733145c0a9ddfa08
parentc138bf22e0341f59dfa8a4fb7f17136b80a60015 (diff)
bcachefs: Fix an error path in bch2_btree_iter_traverse()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/btree_iter.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index 5c9d53515ca3..8955555d6603 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -959,9 +959,10 @@ static void btree_iter_up(struct btree_iter *iter)
int __must_check __bch2_btree_iter_traverse(struct btree_iter *);
static int __btree_iter_traverse_all(struct btree_trans *trans,
- struct btree_iter *iter, int ret)
+ struct btree_iter *orig_iter, int ret)
{
struct bch_fs *c = trans->c;
+ struct btree_iter *iter;
u8 sorted[BTREE_ITER_MAX];
unsigned i, nr_sorted = 0;
@@ -990,8 +991,8 @@ retry_all:
if (unlikely(ret == -EIO)) {
trans->error = true;
- iter->flags |= BTREE_ITER_ERROR;
- iter->l[iter->level].b = BTREE_ITER_NO_NODE_ERROR;
+ orig_iter->flags |= BTREE_ITER_ERROR;
+ orig_iter->l[orig_iter->level].b = BTREE_ITER_NO_NODE_ERROR;
goto out;
}