Whamcloud - gitweb
LU-10468 tests: sync zfs dataset before reading blocks 28/30828/5
authorJinshan Xiong <jinshan.xiong@intel.com>
Thu, 11 Jan 2018 01:21:25 +0000 (17:21 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 13 Jan 2018 20:13:25 +0000 (20:13 +0000)
Before reading blocks it should synchronize zfs dataset therefore
the block number will be accurate.

Test-Parameters: trivial envdefinitions=SLOW=yes,ENABLE_QUOTA=yes mdtfilesystemtype=zfs ostfilesystemtype=zfs mdscount=2 mdtcount=4 testlist=sanity-flr,sanity-flr,sanity-flr
Test-Parameters: trivial envdefinitions=SLOW=yes,ENABLE_QUOTA=yes mdtfilesystemtype=ldiskfs ostfilesystemtype=ldiskfs mdscount=2 mdtcount=4 testlist=sanity-flr,sanity-flr,sanity-flr
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I663d689296e5847b460de9a491b551a56bfbc77d
Reviewed-on: https://review.whamcloud.com/30828
Tested-by: Jenkins
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/tests/sanity-flr.sh

index ba90384..c3b7cd4 100644 (file)
@@ -695,9 +695,13 @@ test_21() {
        $LFS setstripe -E EOF -o 1 $tf2
 
        local dd_count=$((RANDOM % 20 + 1))
-       dd if=/dev/zero of=$tf bs=1M count=$dd_count
-       dd if=/dev/zero of=$tf2 bs=1M count=1 seek=$((dd_count - 1))
-       cancel_lru_locks osc
+       dd if=/dev/zero of=$tf bs=1M count=$dd_count oflag=sync
+       dd if=/dev/zero of=$tf2 bs=1M count=1 seek=$((dd_count - 1)) oflag=sync
+
+       # for zfs - sync OST dataset so that du below will return
+       # accurate results
+       [ "$FSTYPE" = "zfs" ] &&
+               do_nodes $(comma_list $(osts_nodes)) "$ZPOOL sync"
 
        local blocks=$(du -kc $tf $tf2 | awk '/total/{print $1}')