Fix zfs_clone_010_pos.ksh to verify the space used by multiple copies

The default blocksize in Linux is 1024 due to a GNU-ism.  Setting the
expected blocksize resolves the issue.  As mentioned in the PR an
alternate solution would be to set POSIXLY_CORRECT=1.

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: yuxiang <guo.yong33@zte.com.cn>
Closes #5167
This commit is contained in:
liaoyuxiangqin
2016-09-30 03:46:13 +08:00
committed by Brian Behlendorf
parent 9ec0403d6a
commit f25bc4938d
2 changed files with 8 additions and 3 deletions
@@ -77,9 +77,14 @@ for val in 1 2 3; do
done
log_note "Verify 'ls -s' can correctly list the space charged."
if is_linux; then
blksize=1024
else
blksize=512
fi
for val in 1 2 3; do
blks=`$LS -ls /$TESTPOOL/fs_$val/$FILE | $AWK '{print $1}'`
(( used = blks * 512 / (1024 * 1024) ))
(( used = blks * $blksize / (1024 * 1024) ))
check_used $used $val
done