From: Hongchao Zhang Date: Mon, 31 Dec 2012 19:32:25 +0000 (+0800) Subject: LU-657 test: limit the write size in run_dd X-Git-Tag: 2.3.59~35 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b0f08a4e902411a8fbdb660e5b32c5821ca7159f;hp=467521a236e4c4ef2ad57358cb645083e89f8bdf LU-657 test: limit the write size in run_dd 1, in run_dd.sh, limit the write size of dd according to the free disk space currently intead of using fixed value. 2, fix a bug in ofd_tnx_stop_cb, which cleared the 'thandle->th_sync' Test-Parameters: envdefinitions=SLOW=yes clientcount=4 osscount=2 mdscount=2 austeroptions=-R failover=true useiscsi=true testlist=recovery-mds-scale Signed-off-by: Hongchao Zhang Change-Id: I8b9cc2fc8b9831e5ad79b521ba7af4ae9160143f Reviewed-on: http://review.whamcloud.com/4599 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger --- diff --git a/lustre/ofd/ofd_trans.c b/lustre/ofd/ofd_trans.c index 390a5e1..3112a50 100644 --- a/lustre/ofd/ofd_trans.c +++ b/lustre/ofd/ofd_trans.c @@ -244,9 +244,9 @@ int ofd_txn_stop_cb(const struct lu_env *env, struct thandle *txn, info->fti_transno, ofd_obd(ofd)->obd_last_committed); /* if can't add callback, do sync write */ - txn->th_sync = !!tgt_last_commit_cb_add(txn, &ofd->ofd_lut, - info->fti_exp, - info->fti_transno); + txn->th_sync |= !!tgt_last_commit_cb_add(txn, &ofd->ofd_lut, + info->fti_exp, + info->fti_transno); return ofd_last_rcvd_update(info, txn); } diff --git a/lustre/tests/run_dd.sh b/lustre/tests/run_dd.sh index 36af6ae..6106bb0 100755 --- a/lustre/tests/run_dd.sh +++ b/lustre/tests/run_dd.sh @@ -17,7 +17,7 @@ set -x . $(dirname $0)/functions.sh -assert_env MOUNT END_RUN_FILE LOAD_PID_FILE +assert_env MOUNT END_RUN_FILE LOAD_PID_FILE LFS trap signaled TERM @@ -28,30 +28,36 @@ TESTDIR=$MOUNT/d0.dd-$(hostname) CONTINUE=true while [ ! -e "$END_RUN_FILE" ] && $CONTINUE; do - echoerr "$(date +'%F %H:%M:%S'): dd run starting" - mkdir -p $TESTDIR - cd $TESTDIR - # suppress dd xfer stat to workaround buggy coreutils/gettext - # combination in RHEL5 and OEL5, see BZ 21264 - dd bs=4k count=1000000 status=noxfer if=/dev/zero of=$TESTDIR/dd-file 1>$LOG & - load_pid=$! - wait $load_pid - - if [ $? -eq 0 ]; then - echoerr "$(date +'%F %H:%M:%S'): dd succeeded" - cd $TMP - rm -rf $TESTDIR - echoerr "$(date +'%F %H:%M:%S'): dd run finished" - else - echoerr "$(date +'%F %H:%M:%S'): dd failed" - if [ -z "$ERRORS_OK" ]; then - echo $(hostname) >> $END_RUN_FILE - fi - if [ $BREAK_ON_ERROR ]; then - # break - CONTINUE=false - fi - fi + echoerr "$(date +'%F %H:%M:%S'): dd run starting" + mkdir -p $TESTDIR + $LFS setstripe -c -1 $TESTDIR + cd $TESTDIR + # suppress dd xfer stat to workaround buggy coreutils/gettext + # combination in RHEL5 and OEL5, see BZ 21264 + FREE_SPACE=$($LFS df $TESTDIR|awk '/filesystem summary:/ {print $5}') + BLKS=$((FREE_SPACE * 9 / 40)) + echo "Free disk space is $FREE_SPACE, 4k blocks to dd is $BLKS" + + dd bs=4k count=$BLKS status=noxfer if=/dev/zero of=$TESTDIR/dd-file \ + 1>$LOG & + load_pid=$! + wait $load_pid + + if [ $? -eq 0 ]; then + echoerr "$(date +'%F %H:%M:%S'): dd succeeded" + cd $TMP + rm -rf $TESTDIR + echoerr "$(date +'%F %H:%M:%S'): dd run finished" + else + echoerr "$(date +'%F %H:%M:%S'): dd failed" + if [ -z "$ERRORS_OK" ]; then + echo $(hostname) >> $END_RUN_FILE + fi + if [ $BREAK_ON_ERROR ]; then + # break + CONTINUE=false + fi + fi done echoerr "$(date +'%F %H:%M:%S'): dd run exiting" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 2fa0007..41bdd07 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1531,6 +1531,7 @@ TESTLOG_PREFIX=$TESTLOG_PREFIX \ TESTNAME=$TESTNAME \ DBENCH_LIB=$DBENCH_LIB \ DBENCH_SRC=$DBENCH_SRC \ +LFS=$LFS \ run_${load}.sh" & local ppid=$! log "Started client load: ${load} on $client"