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>
[ $MDSCOUNT -gt 9 ] &&
error "script cannot handle more than 9 MDTs, please fix" && exit
[ $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
check_and_setup_lustre
if [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.4.53) ]]; then
local fid=$(make_small $f)
check_hsm_flags $f "0x00000000"
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)
local orig_size=$(stat -c "%s" $f)
local orig_blocks=$(stat -c "%b" $f)