xfs
[Top] [All Lists]

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

To: david@xxxxxxxxxxxxx, eguan@xxxxxxxxxx, darrick.wong@xxxxxxxxxx
Subject: [PATCH 03/17] xfs/310: fix the size calculation for the huge device
From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Date: Thu, 21 Jul 2016 16:46:35 -0700
Cc: linux-btrfs@xxxxxxxxxxxxxxx, fstests@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <146914477514.11762.3144320628851923350.stgit@xxxxxxxxxxxxxxxx>
References: <146914477514.11762.3144320628851923350.stgit@xxxxxxxxxxxxxxxx>
User-agent: StGit/0.17.1-dirty
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@xxxxxxxxxx>
---
 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"

<Prev in Thread] Current Thread [Next in Thread>