diff mbox

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

Message ID 146914479586.11762.2725828627113169692.stgit@birch.djwong.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Darrick J. Wong July 21, 2016, 11:46 p.m. UTC
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(-)

Comments

Christoph Hellwig Aug. 1, 2016, 6:25 a.m. UTC | #1
On Thu, Jul 21, 2016 at 04:46:35PM -0700, Darrick J. Wong wrote:
> 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>

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox

Patch

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"