xfstests: Do not allow step to be zero

Currently 'step' variable which is used as length of the range to
discard can be zero. However it would result in error returned by the
fstrim.

Fix this by forcing 'step' to be at least 4KB.

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:34 +00:00
committed by Rich Johnston
parent 00d1bda60d
commit 0b85927310
+1 -1
View File
@@ -94,7 +94,7 @@ fstrim_loop()
mmlen=$(_guess_max_minlen)
while true ; do
step=$((RANDOM*$RANDOM))
step=$((RANDOM*$RANDOM+4))
minlen=$(((RANDOM*($RANDOM%2+1))%$mmlen))
start=$RANDOM
if [ $((RANDOM%10)) -gt 7 ]; then