From: Andrew Dahl Date: Wed, 14 Nov 2012 18:52:26 +0000 (-0600) Subject: xfs: reverse the check on XFS_IOC_ZERO_RANGE X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d6638ae244f6323fcdf85e72eb4a5af6f6212893;p=linux-beck.git xfs: reverse the check on XFS_IOC_ZERO_RANGE Reversing the check on XFS_IOC_ZERO_RANGE. Range should be zeroed if the start is less than or equal to the end. Signed-off-by: Andrew Dahl Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index de3702a57e55..46a7a5de5d6d 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2188,7 +2188,7 @@ xfs_change_file_space( case XFS_IOC_ZERO_RANGE: prealloc_type |= XFS_BMAPI_CONVERT; end = round_down(startoffset + bf->l_len, PAGE_SIZE) - 1; - if (startoffset > end) + if (startoffset <= end) truncate_pagecache_range(VFS_I(ip), startoffset, end); /* FALLTHRU */ case XFS_IOC_RESVSP: