]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/310: fix the size calculation for the huge device
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 21 Jul 2016 23:46:35 +0000 (16:46 -0700)
committerEryu Guan <eguan@redhat.com>
Fri, 5 Aug 2016 02:32:10 +0000 (10:32 +0800)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/xfs/310

index bfdec39a00c33b078cc21aaf0685637f229e109f..5125773e9542e080d6f54b29db78e7aff32ea3c1 100755 (executable)
@@ -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"