]> git.hungrycats.org Git - linux/commitdiff
btrfs: reada, remove pointless BUG_ON in reada_find_extent
authorDavid Sterba <dsterba@suse.com>
Tue, 8 Nov 2016 16:11:27 +0000 (17:11 +0100)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Sat, 10 Dec 2016 05:05:28 +0000 (00:05 -0500)
The lock is held, we make the same lookup that previously failed with
EEXIST and we don't insert NULL pointers.

Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit 8694bb61360554e751f43688a9ff1793609884c4)

fs/btrfs/reada.c

index 49b3fb73ffbfcd5d955e4dc2d7955c1d4c20987b..516d10219b361ae7c35171e778b50fa8af0d4b3e 100644 (file)
@@ -401,7 +401,6 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
        ret = radix_tree_insert(&fs_info->reada_tree, index, re);
        if (ret == -EEXIST) {
                re_exist = radix_tree_lookup(&fs_info->reada_tree, index);
-               BUG_ON(!re_exist);
                re_exist->refcnt++;
                spin_unlock(&fs_info->reada_lock);
                btrfs_dev_replace_unlock(&fs_info->dev_replace);