xfs: reverse the check on XFS_IOC_ZERO_RANGE
authorAndrew Dahl <adahl@sgi.com>
Wed, 14 Nov 2012 18:52:26 +0000 (12:52 -0600)
committerBen Myers <bpm@sgi.com>
Wed, 14 Nov 2012 21:11:52 +0000 (15:11 -0600)
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 <adahl@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_vnodeops.c

index de3702a57e556c0458b0fa8f60f51342199f42db..46a7a5de5d6d5f36a53fe36a7beac0680abd49ec 100644 (file)
@@ -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: