diff mbox

xfs/310: relax extent count check

Message ID 20170903155101.GA30258@lst.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig Sept. 3, 2017, 3:51 p.m. UTC
If we got over the bmbt length we'll always allocate two extents,
its just that so far getbmap merged them.

Also fix/update some comments.

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eryu Guan Sept. 6, 2017, 7:34 a.m. UTC | #1
Hi Darrick,

On Sun, Sep 03, 2017 at 05:51:01PM +0200, Christoph Hellwig wrote:
> If we got over the bmbt length we'll always allocate two extents,
> its just that so far getbmap merged them.
> 
> Also fix/update some comments.

Could you please help review this patch? Thanks a lot!

Eryu

> 
> diff --git a/tests/xfs/310 b/tests/xfs/310
> index c78f6f1..f33a15a 100755
> --- a/tests/xfs/310
> +++ b/tests/xfs/310
> @@ -1,7 +1,7 @@
>  #! /bin/bash
>  # FS QA Test No. 310
>  #
> -# Create a file with more than 2^21 extents (the max length of a bmbt record).
> +# Create a file with more than 2^21 blocks (the max length of a bmbt record).
>  #
>  #-----------------------------------------------------------------------
>  # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
> @@ -75,8 +75,9 @@ mkdir $testdir
>  blksz="$(_get_block_size $testdir)"
>  $XFS_IO_PROG -f -c "falloc 0 $((nr_blks * blksz))" $testdir/file1 >> $seqres.full
>  
> +# make sure the allocator didn't allocate more than the needed two extents
>  echo "Check extent count"
> -xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*1:' -q && xfs_bmap -l -p -v $testdir/file1
> +xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*2:' -q && xfs_bmap -l -p -v $testdir/file1
>  inum=$(stat -c '%i' $testdir/file1)
>  umount $SCRATCH_MNT
>  
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eryu Guan Sept. 14, 2017, 4:09 a.m. UTC | #2
[adding linux-xfs list]

On Sun, Sep 03, 2017 at 05:51:01PM +0200, Christoph Hellwig wrote:
> If we got over the bmbt length we'll always allocate two extents,
> its just that so far getbmap merged them.
> 
> Also fix/update some comments.
> 
> diff --git a/tests/xfs/310 b/tests/xfs/310
> index c78f6f1..f33a15a 100755
> --- a/tests/xfs/310
> +++ b/tests/xfs/310
> @@ -1,7 +1,7 @@
>  #! /bin/bash
>  # FS QA Test No. 310
>  #
> -# Create a file with more than 2^21 extents (the max length of a bmbt record).
> +# Create a file with more than 2^21 blocks (the max length of a bmbt record).
>  #
>  #-----------------------------------------------------------------------
>  # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
> @@ -75,8 +75,9 @@ mkdir $testdir
>  blksz="$(_get_block_size $testdir)"
>  $XFS_IO_PROG -f -c "falloc 0 $((nr_blks * blksz))" $testdir/file1 >> $seqres.full
>  
> +# make sure the allocator didn't allocate more than the needed two extents
>  echo "Check extent count"
> -xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*1:' -q && xfs_bmap -l -p -v $testdir/file1
> +xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*2:' -q && xfs_bmap -l -p -v $testdir/file1

It'd be great if someone could help to review this change. Thanks a lot!

Eryu

>  inum=$(stat -c '%i' $testdir/file1)
>  umount $SCRATCH_MNT
>  
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darrick J. Wong Sept. 18, 2017, 9:10 p.m. UTC | #3
On Sun, Sep 03, 2017 at 05:51:01PM +0200, Christoph Hellwig wrote:
> If we got over the bmbt length we'll always allocate two extents,
> its just that so far getbmap merged them.
> 
> Also fix/update some comments.
> 
> diff --git a/tests/xfs/310 b/tests/xfs/310
> index c78f6f1..f33a15a 100755
> --- a/tests/xfs/310
> +++ b/tests/xfs/310
> @@ -1,7 +1,7 @@
>  #! /bin/bash
>  # FS QA Test No. 310
>  #
> -# Create a file with more than 2^21 extents (the max length of a bmbt record).
> +# Create a file with more than 2^21 blocks (the max length of a bmbt record).
>  #
>  #-----------------------------------------------------------------------
>  # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
> @@ -75,8 +75,9 @@ mkdir $testdir
>  blksz="$(_get_block_size $testdir)"
>  $XFS_IO_PROG -f -c "falloc 0 $((nr_blks * blksz))" $testdir/file1 >> $seqres.full
>  
> +# make sure the allocator didn't allocate more than the needed two extents
>  echo "Check extent count"
> -xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*1:' -q && xfs_bmap -l -p -v $testdir/file1
> +xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*2:' -q && xfs_bmap -l -p -v $testdir/file1

I haven't had time to read the getbmap rework over in xfs-land yet, but
I'm assuming from this diff that the new getbmap no longer merges adjacent
records?

Also, won't this break the test on old kernels?

--D

>  inum=$(stat -c '%i' $testdir/file1)
>  umount $SCRATCH_MNT
>  
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Sept. 18, 2017, 11:39 p.m. UTC | #4
On Mon, Sep 18, 2017 at 02:10:42PM -0700, Darrick J. Wong wrote:
> > +# make sure the allocator didn't allocate more than the needed two extents
> >  echo "Check extent count"
> > -xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*1:' -q && xfs_bmap -l -p -v $testdir/file1
> > +xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*2:' -q && xfs_bmap -l -p -v $testdir/file1
> 
> I haven't had time to read the getbmap rework over in xfs-land yet, but
> I'm assuming from this diff that the new getbmap no longer merges adjacent
> records?

Yes.

> Also, won't this break the test on old kernels?

No - it just checks we don't have more than two extents instead of
checking we don't have more than one, so it just relaxes the check
a bit.
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darrick J. Wong Sept. 19, 2017, 2:28 a.m. UTC | #5
On Sun, Sep 03, 2017 at 05:51:01PM +0200, Christoph Hellwig wrote:
> If we got over the bmbt length we'll always allocate two extents,
> its just that so far getbmap merged them.
> 
> Also fix/update some comments.
> 

Needs a s-o-b.  Otherwise,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> diff --git a/tests/xfs/310 b/tests/xfs/310
> index c78f6f1..f33a15a 100755
> --- a/tests/xfs/310
> +++ b/tests/xfs/310
> @@ -1,7 +1,7 @@
>  #! /bin/bash
>  # FS QA Test No. 310
>  #
> -# Create a file with more than 2^21 extents (the max length of a bmbt record).
> +# Create a file with more than 2^21 blocks (the max length of a bmbt record).
>  #
>  #-----------------------------------------------------------------------
>  # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
> @@ -75,8 +75,9 @@ mkdir $testdir
>  blksz="$(_get_block_size $testdir)"
>  $XFS_IO_PROG -f -c "falloc 0 $((nr_blks * blksz))" $testdir/file1 >> $seqres.full
>  
> +# make sure the allocator didn't allocate more than the needed two extents
>  echo "Check extent count"
> -xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*1:' -q && xfs_bmap -l -p -v $testdir/file1
> +xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*2:' -q && xfs_bmap -l -p -v $testdir/file1
>  inum=$(stat -c '%i' $testdir/file1)
>  umount $SCRATCH_MNT
>  
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eryu Guan Sept. 19, 2017, 2:56 a.m. UTC | #6
On Mon, Sep 18, 2017 at 07:28:59PM -0700, Darrick J. Wong wrote:
> On Sun, Sep 03, 2017 at 05:51:01PM +0200, Christoph Hellwig wrote:
> > If we got over the bmbt length we'll always allocate two extents,
> > its just that so far getbmap merged them.
> > 
> > Also fix/update some comments.
> > 
> 
> Needs a s-o-b.  Otherwise,

I can fix it up.

> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

Thanks for reviewing!

Eryu

> 
> --D
> 
> > diff --git a/tests/xfs/310 b/tests/xfs/310
> > index c78f6f1..f33a15a 100755
> > --- a/tests/xfs/310
> > +++ b/tests/xfs/310
> > @@ -1,7 +1,7 @@
> >  #! /bin/bash
> >  # FS QA Test No. 310
> >  #
> > -# Create a file with more than 2^21 extents (the max length of a bmbt record).
> > +# Create a file with more than 2^21 blocks (the max length of a bmbt record).
> >  #
> >  #-----------------------------------------------------------------------
> >  # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
> > @@ -75,8 +75,9 @@ mkdir $testdir
> >  blksz="$(_get_block_size $testdir)"
> >  $XFS_IO_PROG -f -c "falloc 0 $((nr_blks * blksz))" $testdir/file1 >> $seqres.full
> >  
> > +# make sure the allocator didn't allocate more than the needed two extents
> >  echo "Check extent count"
> > -xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*1:' -q && xfs_bmap -l -p -v $testdir/file1
> > +xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*2:' -q && xfs_bmap -l -p -v $testdir/file1
> >  inum=$(stat -c '%i' $testdir/file1)
> >  umount $SCRATCH_MNT
> >  
> > --
> > To unsubscribe from this list: send the line "unsubscribe fstests" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Sept. 19, 2017, 3:05 a.m. UTC | #7
On Mon, Sep 18, 2017 at 07:28:59PM -0700, Darrick J. Wong wrote:
> On Sun, Sep 03, 2017 at 05:51:01PM +0200, Christoph Hellwig wrote:
> > If we got over the bmbt length we'll always allocate two extents,
> > its just that so far getbmap merged them.
> > 
> > Also fix/update some comments.
> > 
> 
> Needs a s-o-b.  Otherwise,

Hmm, didn;t notice I missed that:

Signed-off-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/xfs/310 b/tests/xfs/310
index c78f6f1..f33a15a 100755
--- a/tests/xfs/310
+++ b/tests/xfs/310
@@ -1,7 +1,7 @@ 
 #! /bin/bash
 # FS QA Test No. 310
 #
-# Create a file with more than 2^21 extents (the max length of a bmbt record).
+# Create a file with more than 2^21 blocks (the max length of a bmbt record).
 #
 #-----------------------------------------------------------------------
 # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
@@ -75,8 +75,9 @@  mkdir $testdir
 blksz="$(_get_block_size $testdir)"
 $XFS_IO_PROG -f -c "falloc 0 $((nr_blks * blksz))" $testdir/file1 >> $seqres.full
 
+# make sure the allocator didn't allocate more than the needed two extents
 echo "Check extent count"
-xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*1:' -q && xfs_bmap -l -p -v $testdir/file1
+xfs_bmap -l -p -v $testdir/file1 | grep '^[[:space:]]*2:' -q && xfs_bmap -l -p -v $testdir/file1
 inum=$(stat -c '%i' $testdir/file1)
 umount $SCRATCH_MNT