Whamcloud - gitweb
LU-12542 handle: discard OBD_FREE_RCU
[fs/lustre-release.git] / lustre / tests / oos.sh
index c547b63..98d2c18 100755 (executable)
@@ -46,7 +46,11 @@ oos_full || true
 
 # make sure we stripe over all OSTs to avoid OOS on only a subset of OSTs
 $LFS setstripe $OOS -c $STRIPECOUNT
-if dd if=/dev/zero of=$OOS count=$(($ORIGFREE + 100)) bs=1k 2> $LOG; then
+# add 20% of margin since the metadata overhead estimated in bavail might be
+# too aggressive and we might be able to write more than reported initially
+# by statfs.
+echo dd size $((ORIGFREE * 120 / 100))kB
+if dd if=/dev/zero of=$OOS count=$((ORIGFREE * 120 / 100)) bs=1k 2> $LOG; then
        echo "ERROR: dd did not fail"
        SUCCESS=0
 fi
@@ -81,13 +85,13 @@ fi
 
 #$LCTL debug_daemon stop
 
-echo LOG file
-cat $LOG
+[ $SUCCESS != 0 ] && echo LOG file && sed "s/^/LOG: /" $LOG
 rm -f $OOS
-sync; sleep 1; sync
 
 sync; sleep 3; sync
 
+wait_delete_completed 300
+
 if [ $SUCCESS -eq 1 ]; then
        echo "Success!"
        rm -f $LOG