aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-12-05 05:53:45 -0500
committerChris Mason <chris.mason@fusionio.com>2012-12-16 20:46:19 -0500
commit6347b3c433a4cff00eb2299c7f2c7d1d8b24c1fc (patch)
tree528eabdcc7fe59c50ac8dba4347851f05ff83b2d /fs/btrfs/file.c
parent4b5829a8e3104c8bc115d926a0285d3ff9bcfc77 (diff)
Btrfs: fix off-by-one error of the same page check in btrfs_punch_hole()
(start + len) is the start of the adjacent extent, not the end of the current extent, so we should not use it to check the hole is on the same page or not. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 8e3d6788d6dd..d75412bf7c4a 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1867,8 +1867,8 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
1867 u64 drop_end; 1867 u64 drop_end;
1868 int ret = 0; 1868 int ret = 0;
1869 int err = 0; 1869 int err = 0;
1870 bool same_page = (offset >> PAGE_CACHE_SHIFT) == 1870 bool same_page = ((offset >> PAGE_CACHE_SHIFT) ==
1871 ((offset + len) >> PAGE_CACHE_SHIFT); 1871 ((offset + len - 1) >> PAGE_CACHE_SHIFT));
1872 1872
1873 btrfs_wait_ordered_range(inode, offset, len); 1873 btrfs_wait_ordered_range(inode, offset, len);
1874 1874