btrfs: handle ENOENT in btrfs_uuid_tree_iterate
authorJosef Bacik <josef@toxicpanda.com>
Fri, 6 Dec 2019 16:39:00 +0000 (11:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:42:05 +0000 (16:42 +0100)
commit785c7ecae1b4a0d7bb4abbf355598337493fefd2
treed55ef4390e2baf22d4bc4b97eb7b13155f8af79a
parent15b1de9197d01a1cafc0b652ec0ec3dc2d1b7bb5
btrfs: handle ENOENT in btrfs_uuid_tree_iterate

commit 714cd3e8cba6841220dce9063a7388a81de03825 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/uuid-tree.c