X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fracer%2Ffile_create.sh;h=e6153653915cad7522ff78c399702e403fead16e;hp=828e69c452c624f11bed29b4702c219b6d5a5a5e;hb=6acd28ed6ce281843b2bf2892ffa0e8725d08f3a;hpb=3ea78dd02a57211ae9b55111323d14cfbc71bc43 diff --git a/lustre/tests/racer/file_create.sh b/lustre/tests/racer/file_create.sh index 828e69c..e615365 100755 --- a/lustre/tests/racer/file_create.sh +++ b/lustre/tests/racer/file_create.sh @@ -2,16 +2,17 @@ DIR=$1 MAX=$2 -MAX_MB=256 +MAX_MB=${RACER_MAX_MB:-8} OSTCOUNT=${OSTCOUNT:-$(lfs df $DIR 2> /dev/null | grep -c OST)} while /bin/true ; do file=$((RANDOM % MAX)) - SIZE=$((RANDOM * MAX_MB / 32)) - echo "file_create: FILE=$DIR/$file SIZE=$SIZE" + # $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 $((RANDOM % OSTCOUNT)) $DIR/$file 2> /dev/null - dd if=/dev/zero of=$DIR/$file bs=1k count=$SIZE 2> /dev/null + lfs setstripe -c $stripecount $DIR/$file 2> /dev/null + dd if=/dev/zero of=$DIR/$file bs=64k count=$blockcount 2> /dev/null done