Whamcloud - gitweb
b=15747
[fs/lustre-release.git] / lustre / tests / oos.sh
index 3da2ceb..ba9bec3 100755 (executable)
@@ -27,7 +27,7 @@ ORIGFREE=`cat /proc/fs/lustre/llite/*/kbytesavail | head -n 1`
 MAXFREE=${MAXFREE:-$((400000 * $STRIPECOUNT))}
 if [ $ORIGFREE -gt $MAXFREE ]; then
        echo "skipping out-of-space test on $OSC"
-       echo "reports ${ORIGFREE}kB free, more tham MAXFREE ${MAXFREE}kB"
+       echo "reports ${ORIGFREE}kB free, more than MAXFREE ${MAXFREE}kB"
        echo "increase $MAXFREE (or reduce test fs size) to proceed"
        exit 0
 fi
@@ -37,7 +37,7 @@ export LANG=C LC_LANG=C # for "No space left on device" message
 [ -f $LOG ] && echo "ERROR: log file wasn't removed?" && exit 1
 
 # make sure we stripe over all OSTs to avoid OOS on only a subset of OSTs
-$LFS setstripe $OOS 65536 0 $STRIPECOUNT
+$LFS setstripe $OOS -c $STRIPECOUNT
 if dd if=/dev/zero of=$OOS count=$(($ORIGFREE + 100)) bs=1k 2> $LOG; then
        echo "ERROR: dd did not fail"
        SUCCESS=0
@@ -54,8 +54,10 @@ sync; sleep 1 ; sync
 
 for OSC in /proc/fs/lustre/osc/*-osc-*; do
        AVAIL=`cat $OSC/kbytesavail`
-       GRANT=`cat $OSC/cur_grant_bytes`
-       [ $(($AVAIL - $GRANT / 1024)) -lt 400 ] && OSCFULL=full
+       GRANT=$((`cat $OSC/cur_grant_bytes` / 1024))
+       echo -n "$(basename $OSC) avl=$AVAIL grnt=$GRANT diff=$(($AVAIL - $GRANT))"
+       [ $(($AVAIL - $GRANT)) -lt 400 ] && OSCFULL=full && echo -n " FULL"
+       echo " "
 done
 
 if [ -z "$OSCFULL" ]; then
@@ -78,6 +80,9 @@ fi
 #lctl debug_daemon stop
 
 rm -f $OOS
+sync; sleep 1; sync
+
+sync; sleep 3; sync
 
 if [ $SUCCESS -eq 1 ]; then
        echo "Success!"