Skip to contentSkip to conversation

xfs/310: relax extent count check

PATCH Christoph Hellwig 3 participants 8 messages Sep 3, 2017 – Sep 19, 2017

lore
Share & tools
lore
#0 lore raw

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.

tests/xfs/310 +3 -2
index c78f6f1..f33a15a 100755
@@ -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
 
#1 lore raw

Hi Darrick,

Quoted 4 lines · Christoph Hellwig

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

Quoted 29 lines
tests/xfs/310 +3 -3
index c78f6f1..f33a15a 100755
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Christoph Hellwig

[adding linux-xfs list]

Quoted 19 lines · Christoph Hellwig

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.

tests/xfs/310 +1 -1
index c78f6f1..f33a15a 100755
@@ -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.

tests/xfs/310 mkdir $testdir · line 80

Quoted 7 lines
tests/xfs/310 +2 -1
@@ -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

Quoted 7 lines
tests/xfs/310 +0 -1
 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Christoph Hellwig
Quoted 19 lines · Christoph Hellwig

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.

tests/xfs/310 +1 -1
index c78f6f1..f33a15a 100755
@@ -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.

tests/xfs/310 mkdir $testdir · line 80

Quoted 7 lines
tests/xfs/310 +2 -1
@@ -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

Quoted 7 lines
tests/xfs/310 +0 -1
 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 8 lines · Darrick J. Wong

tests/xfs/310 mkdir $testdir · line 80

Quoted 4 lines
tests/xfs/310 +2 -1
+# 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.

Quoted 1 line

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.

Reviewed-by
#5 lore raw
In reply to Christoph Hellwig
Quoted 5 lines · Christoph Hellwig

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,

--D

Quoted 28 lines
tests/xfs/310 +3 -3
index c78f6f1..f33a15a 100755
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 8 lines · Darrick J. Wong
Quoted 5 lines · Christoph Hellwig

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.

Quoted 1 line

Thanks for reviewing!

Eryu

Quoted 35 lines

--D

Quoted 25 lines
tests/xfs/310 +3 -3
index c78f6f1..f33a15a 100755
@@ -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
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html