summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-09-23 20:23:16 -0400
committerChris Mason <chris.mason@oracle.com>2009-09-23 20:30:52 -0400
commit46562cec98368623bcd18d7fd30f20c04afd5978 (patch)
tree4e5bbba7f459a1094b09413f65239b26401117f8 /fs/btrfs/extent_io.c
parent42daec299b8b6b9605976d0ee1266b343a31cbcc (diff)
downloadop-kernel-dev-46562cec98368623bcd18d7fd30f20c04afd5978.zip
op-kernel-dev-46562cec98368623bcd18d7fd30f20c04afd5978.tar.gz
Btrfs: Fix test_range_bit for whole file extents
If test_range_bit finds an extent that goes all the way to (u64)-1, it can incorrectly wrap the u64 instead of treaing it like the end of the address space. This just adds a check for the highest possible offset so we don't wrap. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index b950654..dcce98d 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1564,6 +1564,10 @@ int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end,
bitset = 0;
break;
}
+
+ if (state->end == (u64)-1)
+ break;
+
start = state->end + 1;
if (start > end)
break;
OpenPOWER on IntegriCloud