ocfs2: return EINVAL if the given range to discard is less than block size
authorJie Liu <[email protected]>
Tue, 21 Jan 2014 23:48:35 +0000 (15:48 -0800)
committerLinus Torvalds <[email protected]>
Wed, 22 Jan 2014 00:19:42 +0000 (16:19 -0800)
commitaa89762c54800208d5afdcd8e6bf124818f17fe0
tree36beda22a4b7bc8697fbd05a02af4a2d0dab1b04
parent19e8ac2721148a475833d7b5f893f9b81fbb0045
ocfs2: return EINVAL if the given range to discard is less than block size

For FITRIM ioctl(2), we should not keep silence if the given range
length ls less than a block size as there is no data blocks would be
discareded.  Hence it should return EINVAL instead.  This issue can be
verified via xfstests/generic/288 which is used for FITRIM argument
handling tests.

Signed-off-by: Jie Liu <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/ocfs2/alloc.c