Fix fail on zero-size append Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at> Signed-off-by: Richard Weinberger <richard@nod.at>
diff --git a/fsstress.sh b/fsstress.sh index 3b112b0..f74cb4c 100755 --- a/fsstress.sh +++ b/fsstress.sh
@@ -88,8 +88,11 @@ do SIZE=$(($RANDOM % $MAX_SIZE_MB)) - dd if=/dev/urandom of=testdir/smallfile$i bs=1M count=$SIZE\ - oflag=append conv=notrunc &> /dev/null + if [ $SIZE -gt 0 ] + then + dd if=/dev/urandom of=testdir/smallfile$i bs=1M count=$SIZE\ + oflag=append conv=notrunc &> /dev/null + fi done } @@ -99,9 +102,12 @@ do SIZE=$(($RANDOM % $MAX_SIZE_MB)) - dd if=/dev/urandom of=testdir/smallfile$i bs=1M count=$SIZE\ - oflag=append conv=notrunc &> /dev/null - sync + if [ $SIZE -gt 0 ] + then + dd if=/dev/urandom of=testdir/smallfile$i bs=1M count=$SIZE\ + oflag=append conv=notrunc &> /dev/null + sync + fi done }