]> git.hungrycats.org Git - linux/commitdiff
btrfs: handle ENOENT in btrfs_uuid_tree_iterate
authorJosef Bacik <josef@toxicpanda.com>
Wed, 4 Dec 2019 16:18:08 +0000 (08:18 -0800)
committerJosef Bacik <josef@toxicpanda.com>
Fri, 6 Dec 2019 16:34:43 +0000 (08:34 -0800)
If we get an -ENOENT back from btrfs_uuid_iter_rem when iterating the
uuid tree we'll just continue and do btrfs_next_item().  However we've
done a btrfs_release_path() at this point and no longer have a valid
path.  So increment the key and go back and do a normal search.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
fs/btrfs/uuid-tree.c

index 91caab63bdf521e5e16f30cd0e8428fb7b242a3b..76b84f2397b1bc75167e6db1d433674c0620760f 100644 (file)
@@ -324,6 +324,8 @@ again_search_slot:
                                }
                                if (ret < 0 && ret != -ENOENT)
                                        goto out;
+                               key.offset++;
+                               goto again_search_slot;
                        }
                        item_size -= sizeof(subid_le);
                        offset += sizeof(subid_le);