Fix for test_range_bit
authorYan <yanzheng@21cn.com>
Tue, 22 Jan 2008 16:34:13 +0000 (11:34 -0500)
committerDavid Woodhouse <dwmw2@hera.kernel.org>
Tue, 22 Jan 2008 16:34:13 +0000 (11:34 -0500)
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.

extent_map.c

index c797926..bc67c0e 100644 (file)
@@ -473,6 +473,11 @@ int test_range_bit(struct extent_map_tree *tree, u64 start, u64 end,
                if (start > end)
                        break;
                node = next_cache_extent(node);
+               if (!node) {
+                       if (filled)
+                               bitset = 0;
+                       break;
+               }
        }
        return bitset;
 }