Skip to content

Commit

Permalink
xfs: reverse the check on XFS_IOC_ZERO_RANGE
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Dahl authored and Ben Myers committed Nov 14, 2012
1 parent f5b8911 commit d6638ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d6638ae

Please sign in to comment.