1
0
Fork 0

btrfs: handle ENOENT in btrfs_uuid_tree_iterate

commit 714cd3e8cb 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>
5.4-rM2-2.2.x-imx-squashed
Josef Bacik 2019-12-06 11:39:00 -05:00 committed by Greg Kroah-Hartman
parent 15b1de9197
commit 785c7ecae1
1 changed files with 2 additions and 0 deletions

View 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);