X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Foos2.sh;h=84c87f1135b9ae7e9a3f7e4305b608c14eaa1452;hb=e52a140eb7f65a63f07dbb7e2aaff7f9e22974f2;hp=22c6893be15df86ec6720c70924d00c3aa010f04;hpb=090c677210ee2946d99c71412e4ff762bb300f4f;p=fs%2Flustre-release.git diff --git a/lustre/tests/oos2.sh b/lustre/tests/oos2.sh index 22c6893..84c87f1 100644 --- a/lustre/tests/oos2.sh +++ b/lustre/tests/oos2.sh @@ -20,8 +20,8 @@ rm -f $OOS $OOS2 $LOG $LOG2 sleep 1 # to ensure we get up-to-date statfs info -STRIPECOUNT=`cat /proc/fs/lustre/lov/*/activeobd | head -1` -ORIGFREE=`cat /proc/fs/lustre/llite/*/kbytesavail | head -1` +STRIPECOUNT=`cat /proc/fs/lustre/lov/*/activeobd | head -n 1` +ORIGFREE=`cat /proc/fs/lustre/llite/*/kbytesavail | head -n 1` MAXFREE=${MAXFREE:-$((200000 * $STRIPECOUNT))} if [ $ORIGFREE -gt $MAXFREE ]; then echo "skipping out-of-space test on $OSC" @@ -54,12 +54,14 @@ fi # flush cache to OST(s) so avail numbers are correct sync; sleep 1 ; sync -for AVAIL in /proc/fs/lustre/osc/OSC*MNT*/kbytesavail; do - [ `cat $AVAIL` -lt 400 ] && OSCFULL=full +for OSC in /proc/fs/lustre/osc/OSC*MNT*; do + AVAIL=`cat $OSC/kbytesavail` + GRANT=`cat $OSC/cur_grant_bytes` + [ $(($AVAIL - $GRANT / 1024)) -lt 400 ] && OSCFULL=full done if [ -z "$OSCFULL" ]; then echo "no OSTs are close to full" - grep "[0-9]" /proc/fs/lustre/osc/OSC*MNT*/{kbytesavail,cur*} |tee -a $LOG + grep [0-9] /proc/fs/lustre/osc/OSC*MNT*/{kbytesavail,cur*} |tee -a $LOG SUCCESS=0 fi