Whamcloud - gitweb
Land b_smallfix onto HEAD (20040414_1359)
[fs/lustre-release.git] / lustre / tests / oos.sh
index 5a2646a..4e6b261 100755 (executable)
@@ -49,12 +49,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*}
+       grep [0-9] /proc/fs/lustre/osc/OSC*MNT*/{kbytesavail,cur*}
        SUCCESS=0
 fi