From: Filipe David Borba Manana Date: Tue, 19 Nov 2013 16:19:24 +0000 (+0000) Subject: Btrfs: fix ordered extent check in btrfs_punch_hole X-Git-Tag: v3.14-rc2~3^2~121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6126e3caf7468a07cc1a8239d9e95090acedd3ca;p=profile%2Fcommon%2Fkernel-common.git Btrfs: fix ordered extent check in btrfs_punch_hole If the ordered extent's last byte was 1 less than our region's start byte, we would unnecessarily wait for the completion of that ordered extent, because it doesn't intersect our target range. Signed-off-by: Filipe David Borba Manana Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 6cd003c..740ae8c 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2164,7 +2164,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) * we need to try again. */ if ((!ordered || - (ordered->file_offset + ordered->len < lockstart || + (ordered->file_offset + ordered->len <= lockstart || ordered->file_offset > lockend)) && !test_range_bit(&BTRFS_I(inode)->io_tree, lockstart, lockend, EXTENT_UPTODATE, 0,