In rechecking zone-in-tree, we still need to check zone include
our logical address.

Signed-off-by: Zhao Lei <[email protected]>
---
 fs/btrfs/reada.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
index d8116fe..c65b42f 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);
 
-- 
1.8.5.1



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to