Whamcloud - gitweb
LU-3700 tests: zfs: work around blocks check for sanity-hsm/21
[fs/lustre-release.git] / 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)