summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_map.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-12-21 16:27:23 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commit5d4fb734b4cb89a3902d6de309af0f6f3e63fe73 (patch)
tree0ceeb3fb26c6d8b49c0ba902f24e94e37f58f52c /fs/btrfs/extent_map.c
parent1832a6d5ee3b1af61001cadba9e10da9e91af4a4 (diff)
downloadop-kernel-dev-5d4fb734b4cb89a3902d6de309af0f6f3e63fe73.zip
op-kernel-dev-5d4fb734b4cb89a3902d6de309af0f6f3e63fe73.tar.gz
Btrfs: Fix an off by one in the extent_map prepare write code
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r--fs/btrfs/extent_map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 2b92f10..f53d8c9 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -2270,7 +2270,7 @@ int extent_prepare_write(struct extent_map_tree *tree,
kunmap_atomic(kaddr, KM_USER0);
}
if ((em->block_start != EXTENT_MAP_HOLE &&
- em->block_start != EXTENT_MAP_INLINE) &&
+ em->block_start != EXTENT_MAP_INLINE) &&
!isnew && !PageUptodate(page) &&
(block_off_end > to || block_off_start < from) &&
!test_range_bit(tree, block_start, cur_end,
@@ -2279,7 +2279,7 @@ int extent_prepare_write(struct extent_map_tree *tree,
u64 extent_offset = block_start - em->start;
size_t iosize;
sector = (em->block_start + extent_offset) >> 9;
- iosize = (cur_end - block_start + blocksize - 1) &
+ iosize = (cur_end - block_start + blocksize) &
~((u64)blocksize - 1);
/*
* we've already got the extent locked, but we
OpenPOWER on IntegriCloud