xfstests: Test FITRIM where length is smaller than FSB

This tests corner case in FITRIM implementation where range size is
smaller than file system block or zero. In this case FITRIM should fail
with EINVAL.

The problem was spotted in xfs and ext4 where in case of length = 0 the
'end' variable underflowed. In case of length smaller than 1 FSB FITRIM
finished successfully, but we really should rather return EINVAL in both
cases.

(This patch has to be applied after 'Use upstream version of fstrim
instead of the local one')

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
Lukas Czerner
2012-10-16 09:41:33 +00:00
committed by Rich Johnston
parent 8ddf4d1a1e
commit 00d1bda60d
3 changed files with 65 additions and 0 deletions
+1
View File
@@ -406,3 +406,4 @@ deprecated
285 auto rw
286 other
287 auto dump quota quick
288 auto quick ioctl trim