Whamcloud - gitweb
LU-3700 tests: zfs: work around blocks check for sanity-hsm/21 75/8575/4
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Fri, 13 Dec 2013 22:23:53 +0000 (17:23 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 25 Dec 2013 19:37:01 +0000 (19:37 +0000)
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 <nathaniel.l.clark@intel.com>
Change-Id: I99ffac888a80b046b8c446021124e92f0f313f27
Reviewed-on: http://review.whamcloud.com/8575
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/tests/sanity-hsm.sh

index 0d43e33..233db87 100644 (file)
@@ -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)