]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcachefs: Fix an error path in bch2_btree_iter_traverse()
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 24 May 2019 18:33:16 +0000 (14:33 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:22 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.c

index 2579944bb8c1144fcf2017c9a55e5823490203c3..9e6faf7e2830586c1ea80c8f2717433a5ff0c276 100644 (file)
@@ -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;
        }