From fd6d814e5cebd79dd1bf566a601538ab6f310269 Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Fri, 13 Dec 2013 17:23:53 -0500 Subject: [PATCH] LU-3700 tests: zfs: work around blocks check for sanity-hsm/21 The number of blocks for ZFS reflects the number of blocks written to disk. To get an accurate number, the file on the OST needs to be fully flushed. Signed-off-by: Nathaniel Clark Change-Id: I99ffac888a80b046b8c446021124e92f0f313f27 Reviewed-on: http://review.whamcloud.com/8575 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/tests/sanity-hsm.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index 0d43e33..233db87 100644 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -34,10 +34,6 @@ FAIL_ON_ERROR=false [ $MDSCOUNT -gt 9 ] && error "script cannot handle more than 9 MDTs, please fix" && exit -[ $(facet_fstype $SINGLEMDS) = "zfs" ] && -# bug number for skipped test: LU-3700 - ALWAYS_EXCEPT="$ALWAYS_EXCEPT 51b" - check_and_setup_lustre if [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.4.53) ]]; then @@ -1347,6 +1343,15 @@ test_21() { local fid=$(make_small $f) check_hsm_flags $f "0x00000000" + # LU-4388/LU-4389 - ZFS does not report full number of blocks + # used until file is flushed to disk + if [ $(facet_fstype ost1) == "zfs" ]; then + # this causes an OST_SYNC rpc to be sent + dd if=/dev/zero of=$f bs=512 count=1 oflag=sync conv=notrunc,fsync + # clear locks to reread file data + cancel_lru_locks osc + fi + local orig_size=$(stat -c "%s" $f) local orig_blocks=$(stat -c "%b" $f) -- 1.8.3.1