From: Lukas Czerner Date: Tue, 16 Oct 2012 09:41:34 +0000 (+0000) Subject: xfstests: Do not allow step to be zero X-Git-Tag: v2022.05.01~3583 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=0b859273103ebb5cc2c40c02526d2299abf4af04 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 Reviewed-by: Dave Chinner Signed-off-by: Rich Johnston --- diff --git a/251 b/251 index dbb6ba73..74f99946 100755 --- a/251 +++ b/251 @@ -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