- SIZE=$((RANDOM * MAX_MB / 32))
- echo "file_create: FILE=$DIR/$file SIZE=$SIZE"
- [ $OSTCOUNT -gt 0 ] && $RACER_SETSTRIPE &&
- lfs setstripe -c $((RANDOM % OSTCOUNT)) $DIR/$file 2> /dev/null
- dd if=/dev/zero of=$DIR/$file bs=1k count=$SIZE 2> /dev/null
+ # $RANDOM is between 0 and 32767, and we want $blockcount in 64kB units
+ blockcount=$((RANDOM * MAX_MB / 32 / 64))
+ stripecount=$((RANDOM % (OSTCOUNT + 1)))
+ [ $OSTCOUNT -gt 0 ] &&
+ lfs setstripe -c $stripecount $DIR/$file 2> /dev/null
+ dd if=/dev/zero of=$DIR/$file bs=64k count=$blockcount 2> /dev/null