Whamcloud - gitweb
LU-213 using direct io for quota test to avoid cache problem
authorhongchao.zhang <hongchao.zhang@whamcloud.com>
Sun, 3 Apr 2011 07:28:09 +0000 (15:28 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 19 May 2011 00:44:41 +0000 (17:44 -0700)
in test_14a of sanity-qutota.sh, the data written was cached in client side,
which causes the test failed, using "mulitop ${TESTFILE} oO_DIRECT" (direct IO)
instead of "dd" to avoid such issue.

Change-Id: I0802c2ea200483c148e4e7f61e2c6d4b34500f01
Signed-off-by: Hongchao Zhang <hongchao.zhang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/435
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/tests/sanity-quota.sh

index 4dfd603..f749443 100644 (file)
@@ -1194,10 +1194,10 @@ test_14a() {    # was test_14 b=12223 -- setting quota on root
        $LFS setquota -u root -b 10 -B 10 -i 10 -I 10 $DIR
        createmany -m ${TESTFILE} 20 || \
            quota_error u root "unexpected: user(root) create files failly!"
-       dd if=/dev/zero of=$TESTFILE bs=4k count=4096 || \
+        multiop ${TESTFILE} oO_CREAT:O_WRONLY:O_DIRECT:w$((4096 * 4096))c || \
            quota_error u root "unexpected: user(root) write files failly!"
        chmod 666 $TESTFILE
-       $RUNAS dd if=/dev/zero of=${TESTFILE} seek=4096 bs=4k count=4096 && \
+        $RUNAS multiop ${TESTFILE} oO_WRONLY:O_APPEND:O_DIRECT:w$((4096 * 4096))c && \
            quota_error u root "unexpected: user(quota_usr) write a file successfully!"
 
        # trigger the llog