summaryrefslogtreecommitdiff
path: root/fs/btrfs/reada.c
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2015-12-18 21:56:08 +0800
committerDavid Sterba <dsterba@suse.com>2016-02-16 13:21:45 +0100
commit8e9aa51f5405b2a01a44818120116b65a2ba4d3a (patch)
tree1f6985d6d270bab63ac448cab99b88ab492fc436 /fs/btrfs/reada.c
parentc37f49c7ef317fb8043fd28594d1e5d728a1ef89 (diff)
btrfs: reada: Add missed segment checking in reada_find_zone
In rechecking zone-in-tree, we still need to check zone include our logical address. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/reada.c')
-rw-r--r--fs/btrfs/reada.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
index 74480809be76..7e5d4ac800d9 100644
--- a/fs/btrfs/reada.c
+++ b/fs/btrfs/reada.c
@@ -303,8 +303,10 @@ static struct reada_zone *reada_find_zone(struct btrfs_fs_info *fs_info,
kfree(zone);
ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone,
logical >> PAGE_CACHE_SHIFT, 1);
- if (ret == 1)
+ if (ret == 1 && logical >= zone->start && logical <= zone->end)
kref_get(&zone->refcnt);
+ else
+ zone = NULL;
}
spin_unlock(&fs_info->reada_lock);