xfstests: Test FITRIM where length is smaller than FSB
authorLukas Czerner <lczerner@redhat.com>
Tue, 16 Oct 2012 09:41:33 +0000 (09:41 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 24 Oct 2012 17:43:33 +0000 (12:43 -0500)
commit00d1bda60dcfca273f49c298c3a82be1386fa342
treebbc3b33a6bb1e5b89948f3d9721107c441b08524
parent8ddf4d1a1ea630a610521926c11a63d845edc20d
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>
288 [new file with mode: 0644]
288.out [new file with mode: 0644]
group