[PATCH 03/17] xfs/310: fix the size calculation for the huge device

Darrick J. Wong
2016-07-21T23:46:44Z

Fix the calculation of the dmhuge size. The previous calculation
tried to calculate the size correctly, but got it wrong for 1k
block sizes. Therefore, clean the whole mess up.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
tests/xfs/310 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/xfs/310 b/tests/xfs/310
index bfdec39..5125773 100755
--- a/tests/xfs/310
+++ b/tests/xfs/310
@@ -63,7 +63,9 @@ blksz="$(stat -f $SCRATCH_MNT -c '%S')"
umount $SCRATCH_MNT

echo "Format huge device"
-_dmhugedisk_init $((blksz * 2 * 4400)) # a little over 2^22 blocks
+nr_blks=2100000 # 2^21 plus a little more
+sectors=$(( (nr_blks * 3) * blksz / 512 )) # each AG must have > 2^21 blocks
+_dmhugedisk_init $sectors
_mkfs_dev -d agcount=2 $DMHUGEDISK_DEV
_mount $DMHUGEDISK_DEV $SCRATCH_MNT
xfs_info $SCRATCH_MNT >> $seqres.full
@@ -71,7 +73,6 @@ xfs_info $SCRATCH_MNT >> $seqres.full
echo "Create the original file blocks"
mkdir $testdir
blksz="$(stat -f $testdir -c '%S')"
-nr_blks=2100000 # 2^21 plus a little more
$XFS_IO_PROG -f -c "falloc 0 $((nr_blks * blksz))" $testdir/file1 >> $seqres.full

echo "Check extent count"