summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/uuid-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2019-12-06 17:39:00 +0100
committerDavid Sterba <dsterba@suse.com>2019-12-13 14:10:45 +0100
commit714cd3e8cba6841220dce9063a7388a81de03825 (patch)
treedc44b6d0f8680087c56b13ef90b062c039e3e600 /fs/btrfs/uuid-tree.c
parentbtrfs: abort transaction after failed inode updates in create_subvol (diff)
downloadlinux-714cd3e8cba6841220dce9063a7388a81de03825.tar.xz
linux-714cd3e8cba6841220dce9063a7388a81de03825.zip
btrfs: handle ENOENT in btrfs_uuid_tree_iterate
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. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/uuid-tree.c')
-rw-r--r--fs/btrfs/uuid-tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/uuid-tree.c b/fs/btrfs/uuid-tree.c
index 91caab63bdf5..76b84f2397b1 100644
--- a/fs/btrfs/uuid-tree.c
+++ b/fs/btrfs/uuid-tree.c
@@ -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);