From: Yan Date: Tue, 22 Jan 2008 17:46:56 +0000 (-0500) Subject: Btrfs: Fix for test_range_bit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f0c5da1446cc500856a5e31c9a0e2a7bdd30e663;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Btrfs: Fix for test_range_bit test_range_bit doesn't properly handle the case: there's a hole at the end of the range and there's no other extent_state after the range. Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index d71aed341abd..485cf0719b3c 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -1336,6 +1336,11 @@ int test_range_bit(struct extent_map_tree *tree, u64 start, u64 end, if (start > end) break; node = rb_next(node); + if (!node) { + if (filled) + bitset = 0; + break; + } } read_unlock_irq(&tree->lock); return bitset;