diff mbox series

[V3,06/19] Fix xfs/139 to work with 64k block size

Message ID 20180912062626.14349-7-chandan@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show
Series Fix tests to work on non-4k block sized fs instances | expand

Commit Message

Chandan Rajendra Sept. 12, 2018, 6:26 a.m. UTC
For 64k block size, the agsize provided in the test causes mkfs.xfs to
fail due to insufficient log space. Hence this commit computes agsize
based on block size of the filesystem.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
---
 tests/xfs/139     | 15 +++++++++------
 tests/xfs/139.out |  8 ++++++--
 2 files changed, 15 insertions(+), 8 deletions(-)

Comments

Darrick J. Wong Sept. 17, 2018, 10:29 p.m. UTC | #1
On Wed, Sep 12, 2018 at 11:56:13AM +0530, Chandan Rajendra wrote:
> For 64k block size, the agsize provided in the test causes mkfs.xfs to
> fail due to insufficient log space. Hence this commit computes agsize
> based on block size of the filesystem.
> 
> Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
> ---
>  tests/xfs/139     | 15 +++++++++------
>  tests/xfs/139.out |  8 ++++++--
>  2 files changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/xfs/139 b/tests/xfs/139
> index 2a26635..9ab74c8 100755
> --- a/tests/xfs/139
> +++ b/tests/xfs/139
> @@ -34,17 +34,20 @@ _require_cp_reflink
>  
>  rm -f $seqres.full
>  
> +_scratch_mkfs >/dev/null 2>&1
> +_scratch_mount
> +blksz=$(_get_block_size $SCRATCH_MNT)
> +_scratch_unmount
> +
>  echo "Format and mount"
> -_scratch_mkfs -d agsize=$((32 * 1048576)) > $seqres.full 2>&1
> +_scratch_mkfs -d agsize=$((4400 * $blksz)) > $seqres.full 2>&1

Uh... how did this magic 4400 number come about?  I'd have expected
8192...?

--D

>  _scratch_mount >> $seqres.full 2>&1
>  
>  testdir=$SCRATCH_MNT/test-$seq
>  mkdir $testdir
> -blksz="$(_get_block_size $testdir)"
>  
>  echo "Create the original files"
> -sz=$((48 * 1048576))
> -nr=$((sz / blksz))
> +sz=$((4800 * $blksz))
>  _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
>  _cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
>  _scratch_cycle_mount
> @@ -54,8 +57,8 @@ _pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full
>  _scratch_cycle_mount
>  
>  echo "Compare files"
> -md5sum $testdir/file1 | _filter_scratch
> -md5sum $testdir/file2 | _filter_scratch
> +od -t x1 $testdir/file1 | _filter_od
> +od -t x1 $testdir/file2 | _filter_od
>  #filefrag -v $testdir/file1 $testdir/file2
>  
>  # success, all done
> diff --git a/tests/xfs/139.out b/tests/xfs/139.out
> index dc6a31e..55e03d6 100644
> --- a/tests/xfs/139.out
> +++ b/tests/xfs/139.out
> @@ -3,5 +3,9 @@ Format and mount
>  Create the original files
>  CoW every other block
>  Compare files
> -673c759fb131ccf3336c4f8c549a497e  SCRATCH_MNT/test-139/file1
> -dc802351f6717547cbf4c951b294f952  SCRATCH_MNT/test-139/file2
> +0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62
> +*
> +11300
> +0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61
> +*
> +11300
> -- 
> 2.9.5
>
Chandan Rajendra Sept. 18, 2018, 8:46 a.m. UTC | #2
On Tuesday, September 18, 2018 3:59:18 AM IST Darrick J. Wong wrote:
> On Wed, Sep 12, 2018 at 11:56:13AM +0530, Chandan Rajendra wrote:
> > For 64k block size, the agsize provided in the test causes mkfs.xfs to
> > fail due to insufficient log space. Hence this commit computes agsize
> > based on block size of the filesystem.
> > 
> > Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
> > ---
> >  tests/xfs/139     | 15 +++++++++------
> >  tests/xfs/139.out |  8 ++++++--
> >  2 files changed, 15 insertions(+), 8 deletions(-)
> > 
> > diff --git a/tests/xfs/139 b/tests/xfs/139
> > index 2a26635..9ab74c8 100755
> > --- a/tests/xfs/139
> > +++ b/tests/xfs/139
> > @@ -34,17 +34,20 @@ _require_cp_reflink
> >  
> >  rm -f $seqres.full
> >  
> > +_scratch_mkfs >/dev/null 2>&1
> > +_scratch_mount
> > +blksz=$(_get_block_size $SCRATCH_MNT)
> > +_scratch_unmount
> > +
> >  echo "Format and mount"
> > -_scratch_mkfs -d agsize=$((32 * 1048576)) > $seqres.full 2>&1
> > +_scratch_mkfs -d agsize=$((4400 * $blksz)) > $seqres.full 2>&1
> 
> Uh... how did this magic 4400 number come about?  I'd have expected
> 8192...?

Sorry, I should have added a comment describing the reasoning behind using 4400.
And now, I have forgotten the rational behind choosing 4400 blocks. Most likely
it was to keep the AG size smaller when using 64k block size. The test requires
that file1 occupy enough blocks to overflow an AG and then CoW-ing the same
would cause ENOSPC when expanding the per-AG refcntbt if a bug exists in
the Per-AG reservation.

I will post another version of this patchset which uses 8192 blocks as the 
AG size.
diff mbox series

Patch

diff --git a/tests/xfs/139 b/tests/xfs/139
index 2a26635..9ab74c8 100755
--- a/tests/xfs/139
+++ b/tests/xfs/139
@@ -34,17 +34,20 @@  _require_cp_reflink
 
 rm -f $seqres.full
 
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+blksz=$(_get_block_size $SCRATCH_MNT)
+_scratch_unmount
+
 echo "Format and mount"
-_scratch_mkfs -d agsize=$((32 * 1048576)) > $seqres.full 2>&1
+_scratch_mkfs -d agsize=$((4400 * $blksz)) > $seqres.full 2>&1
 _scratch_mount >> $seqres.full 2>&1
 
 testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
-blksz="$(_get_block_size $testdir)"
 
 echo "Create the original files"
-sz=$((48 * 1048576))
-nr=$((sz / blksz))
+sz=$((4800 * $blksz))
 _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
 _cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
 _scratch_cycle_mount
@@ -54,8 +57,8 @@  _pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full
 _scratch_cycle_mount
 
 echo "Compare files"
-md5sum $testdir/file1 | _filter_scratch
-md5sum $testdir/file2 | _filter_scratch
+od -t x1 $testdir/file1 | _filter_od
+od -t x1 $testdir/file2 | _filter_od
 #filefrag -v $testdir/file1 $testdir/file2
 
 # success, all done
diff --git a/tests/xfs/139.out b/tests/xfs/139.out
index dc6a31e..55e03d6 100644
--- a/tests/xfs/139.out
+++ b/tests/xfs/139.out
@@ -3,5 +3,9 @@  Format and mount
 Create the original files
 CoW every other block
 Compare files
-673c759fb131ccf3336c4f8c549a497e  SCRATCH_MNT/test-139/file1
-dc802351f6717547cbf4c951b294f952  SCRATCH_MNT/test-139/file2
+0 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62
+*
+11300
+0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61
+*
+11300