From 5e29a919c39eee9dacbf7d8b06348b5296b79cd2 Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Wed, 10 Jan 2018 17:21:25 -0800 Subject: [PATCH] LU-10468 tests: sync zfs dataset before reading blocks 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 Change-Id: I663d689296e5847b460de9a491b551a56bfbc77d Reviewed-on: https://review.whamcloud.com/30828 Tested-by: Jenkins Reviewed-by: Jian Yu Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/tests/sanity-flr.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index ba90384..c3b7cd4 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -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}') -- 1.8.3.1