* [PATCH 1/4] xfs/199: enforce v4 superblock format for test
2014-02-02 23:56 [PATCH 0/4] xfstests: xfs and hole punch test fixes Dave Chinner
@ 2014-02-02 23:56 ` Dave Chinner
2014-02-03 7:38 ` Christoph Hellwig
2014-02-02 23:56 ` [PATCH 2/4] xfs/291: fix spurious ENOSPC errors Dave Chinner
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Dave Chinner @ 2014-02-02 23:56 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
This test relies of the contents of the sb_features2 field being
known. Make sure ot clear allt eh MKFS_OPTIONS and ensure that we
direct mkfs to create only the simplest of featuresets to test this
functionality.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
tests/xfs/199 | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/xfs/199 b/tests/xfs/199
index 1d64e02..c1b5962 100755
--- a/tests/xfs/199
+++ b/tests/xfs/199
@@ -49,7 +49,10 @@ _supported_os Linux
_require_scratch
-_scratch_mkfs_xfs -l lazy-count=1 >/dev/null 2>&1
+# clear any mkfs options so taht we can directly specify the options we need to
+# be able to test the features bitmask behaviour correctly.
+MKFS_OPTIONS=
+_scratch_mkfs_xfs -l lazy-count=1 -i projid32bit=0 >/dev/null 2>&1
#
# Print the current flags. Just a dummy so that the test breaks
--
1.8.4.rc3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/4] xfs/291: fix spurious ENOSPC errors
2014-02-02 23:56 [PATCH 0/4] xfstests: xfs and hole punch test fixes Dave Chinner
2014-02-02 23:56 ` [PATCH 1/4] xfs/199: enforce v4 superblock format for test Dave Chinner
@ 2014-02-02 23:56 ` Dave Chinner
2014-02-03 7:38 ` Christoph Hellwig
2014-02-02 23:56 ` [PATCH 3/4] generic: _test_generic_punch not blocksize clean Dave Chinner
2014-02-02 23:56 ` [PATCH 4/4] generic: inconsistent initial state for test_generic_punch Dave Chinner
3 siblings, 1 reply; 9+ messages in thread
From: Dave Chinner @ 2014-02-02 23:56 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
xfs/291 tries to fill the filesystem almost full, so if the log size
changes with mkfs defaults then it's free space calculations are not
longer valid and so it throws lots of ENOSPC errors during a run.
This is not fatal for this test, but it does increase the runtime of
it and fill the 291.full file with unnecessary errors.
The number of frag files it creates is also too many for a 512 byte
inode filesystem (by about 900) so reduce the number of inodes
initially created so the test works ofr 512 byte inodes. With 512
byte inodes, the free space histogram looks like this after the frag
phase:
from to extents blocks pct
1 1 10730 10730 100.00
And for 256 byte inodes:
from to extents blocks pct
1 1 12388 12388 100.00
So these changes do not affect the intended operation of the test.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
tests/xfs/291 | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/xfs/291 b/tests/xfs/291
index d5a9b08..0f3f051 100755
--- a/tests/xfs/291
+++ b/tests/xfs/291
@@ -46,7 +46,7 @@ _supported_os IRIX Linux
# real QA test starts here
rm -f $seqres.full
_require_scratch
-_scratch_mkfs_xfs -n size=16k -d size=128m >> $seqres.full 2>&1
+_scratch_mkfs_xfs -n size=16k -l size=5m -d size=128m >> $seqres.full 2>&1
_scratch_mount
# First we cause very badly fragmented freespace, then
@@ -54,13 +54,16 @@ _scratch_mount
# should come out very fragmented as a result
# Step 1: Cause badly fragmented free space
+#
+# XXX: this needs to be factored to match what generic/204 does to support
+# different inode sizes without ENOSPC
mkdir $SCRATCH_MNT/fragdir
-for I in `seq 0 27200`; do
+for I in `seq 0 26200`; do
(echo data > $SCRATCH_MNT/fragdir/f$I) >> $seqres.full 2>&1
done
sync
-for I in `seq 0 2 27200`; do
+for I in `seq 0 2 26200`; do
rm -f $SCRATCH_MNT/fragdir/f$I >> $seqres.full 2>&1
done
sync
--
1.8.4.rc3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/4] generic: _test_generic_punch not blocksize clean
2014-02-02 23:56 [PATCH 0/4] xfstests: xfs and hole punch test fixes Dave Chinner
2014-02-02 23:56 ` [PATCH 1/4] xfs/199: enforce v4 superblock format for test Dave Chinner
2014-02-02 23:56 ` [PATCH 2/4] xfs/291: fix spurious ENOSPC errors Dave Chinner
@ 2014-02-02 23:56 ` Dave Chinner
2014-02-03 7:39 ` Christoph Hellwig
2014-02-02 23:56 ` [PATCH 4/4] generic: inconsistent initial state for test_generic_punch Dave Chinner
3 siblings, 1 reply; 9+ messages in thread
From: Dave Chinner @ 2014-02-02 23:56 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
Test 17 of _test_generic_punch uses the filesystem block size to do
a sub-single block punch. The result of this is a files of
different sizes and md5sums when the filesystem block size changes.
However the only difference in file contents if the length of the
file - the zeroed region is always in the same place. Hence we can
use hexdump rather than md5sum to check the output remains
consistent and the hole remains in the correct place despite the
changing block sizes.
Fix up all the golden output for all the tests that use this
function, too.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
common/punch | 12 +++++++++---
tests/generic/255.out | 28 ++++++++++++++++++++++++----
tests/generic/316.out | 28 ++++++++++++++++++++++++----
tests/xfs/242.out | 7 ++++++-
tests/xfs/252.out | 28 ++++++++++++++++++++++++----
5 files changed, 87 insertions(+), 16 deletions(-)
diff --git a/common/punch b/common/punch
index a49638c..4ed8406 100644
--- a/common/punch
+++ b/common/punch
@@ -516,6 +516,12 @@ _test_generic_punch()
rm -f $testfile.2
_md5_checksum $testfile
+ # different file sizes mean we can't use md5sum to check the hole is
+ # valid. Hence use hexdump to dump the contents and chop off the last
+ # line of output that indicates the file size. We also have to fudge
+ # the extent size as that will change with file size, too - that's what
+ # the sed line noise does - it will always result in an output of [0..7]
+ # so it matches 4k block size...
echo " 17. data -> hole in single block file"
if [ "$remove_testfile" ]; then
rm -f $testfile
@@ -524,8 +530,8 @@ _test_generic_punch()
$XFS_IO_PROG -f -c "truncate $block_size" \
-c "pwrite 0 $block_size" $sync_cmd \
-c "$zero_cmd 128 128" \
- -c "$map_cmd -v" $testfile | $filter_cmd
+ -c "$map_cmd -v" $testfile | $filter_cmd | \
+ sed -e "s/\.\.[0-9]*\]/..7\]/"
[ $? -ne 0 ] && die_now
- _md5_checksum $testfile
-
+ od -x $testfile | head -n -1
}
diff --git a/tests/generic/255.out b/tests/generic/255.out
index 2ce882b..cb9fdca 100644
--- a/tests/generic/255.out
+++ b/tests/generic/255.out
@@ -72,7 +72,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: extent
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
daa100df6e6711906b61c9ab5aa16032
2. into allocated space
@@ -146,7 +151,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: extent
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
0: [0..7]: extent
1: [8..39]: hole
@@ -225,7 +235,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: extent
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
0: [0..7]: extent
1: [8..39]: hole
@@ -304,4 +319,9 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: extent
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
diff --git a/tests/generic/316.out b/tests/generic/316.out
index 4bb11ec..222e601 100644
--- a/tests/generic/316.out
+++ b/tests/generic/316.out
@@ -36,7 +36,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: extent
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
daa100df6e6711906b61c9ab5aa16032
2. into allocated space
@@ -74,7 +79,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: extent
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
0: [0..7]: extent
1: [8..39]: hole
@@ -118,7 +128,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: extent
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
0: [0..7]: extent
1: [8..39]: hole
@@ -162,4 +177,9 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: extent
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
diff --git a/tests/xfs/242.out b/tests/xfs/242.out
index 72026a3..a516c23 100644
--- a/tests/xfs/242.out
+++ b/tests/xfs/242.out
@@ -74,4 +74,9 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
diff --git a/tests/xfs/252.out b/tests/xfs/252.out
index 3caf9d6..539c8a4 100644
--- a/tests/xfs/252.out
+++ b/tests/xfs/252.out
@@ -72,7 +72,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
daa100df6e6711906b61c9ab5aa16032
2. into allocated space
@@ -146,7 +151,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
0: [0..7]: data
1: [8..39]: hole
@@ -225,7 +235,12 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
1. into a hole
0: [0..7]: data
1: [8..39]: hole
@@ -304,4 +319,9 @@ eecb7aa303d121835de05028751d301c
eecb7aa303d121835de05028751d301c
17. data -> hole in single block file
0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
+0000000 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
+0000200 0000 0000 0000 0000 0000 0000 0000 0000
+*
+0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
+*
--
1.8.4.rc3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] generic: inconsistent initial state for test_generic_punch
2014-02-02 23:56 [PATCH 0/4] xfstests: xfs and hole punch test fixes Dave Chinner
` (2 preceding siblings ...)
2014-02-02 23:56 ` [PATCH 3/4] generic: _test_generic_punch not blocksize clean Dave Chinner
@ 2014-02-02 23:56 ` Dave Chinner
2014-02-03 7:40 ` Christoph Hellwig
3 siblings, 1 reply; 9+ messages in thread
From: Dave Chinner @ 2014-02-02 23:56 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
The first test may start with the file from the previous test, and
that is in an unknown state. Hence always remove the test file
before the first test so that it doesn't have extents inside the
test range as it is supposed to be testing into a hole.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
common/punch | 7 ++++---
tests/generic/255.out | 8 ++------
tests/generic/316.out | 8 ++------
tests/xfs/252.out | 8 ++------
4 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/common/punch b/common/punch
index 4ed8406..49715a7 100644
--- a/common/punch
+++ b/common/punch
@@ -318,10 +318,11 @@ _test_generic_punch()
filter_cmd=$5
testfile=$6
+ # initial test state must be defined, otherwise the first test can fail
+ # due ot stale file state left from previous tests.
+ rm -f $testfile
+
echo " 1. into a hole"
- if [ "$remove_testfile" ]; then
- rm -f $testfile
- fi
$XFS_IO_PROG -f -c "truncate 20k" \
-c "$zero_cmd 4k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
diff --git a/tests/generic/255.out b/tests/generic/255.out
index cb9fdca..217ef3e 100644
--- a/tests/generic/255.out
+++ b/tests/generic/255.out
@@ -158,9 +158,7 @@ eecb7aa303d121835de05028751d301c
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
*
1. into a hole
-0: [0..7]: extent
-1: [8..39]: hole
-5a58e46082be047d0f13bee7974015b9
+daa100df6e6711906b61c9ab5aa16032
2. into allocated space
0: [0..7]: extent
1: [8..23]: hole
@@ -242,9 +240,7 @@ eecb7aa303d121835de05028751d301c
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
*
1. into a hole
-0: [0..7]: extent
-1: [8..39]: hole
-5a58e46082be047d0f13bee7974015b9
+daa100df6e6711906b61c9ab5aa16032
2. into allocated space
0: [0..7]: extent
1: [8..23]: hole
diff --git a/tests/generic/316.out b/tests/generic/316.out
index 222e601..383f0d1 100644
--- a/tests/generic/316.out
+++ b/tests/generic/316.out
@@ -86,9 +86,7 @@ eecb7aa303d121835de05028751d301c
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
*
1. into a hole
-0: [0..7]: extent
-1: [8..39]: hole
-5a58e46082be047d0f13bee7974015b9
+daa100df6e6711906b61c9ab5aa16032
2. into allocated space
0: [0..7]: extent
1: [8..23]: hole
@@ -135,9 +133,7 @@ eecb7aa303d121835de05028751d301c
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
*
1. into a hole
-0: [0..7]: extent
-1: [8..39]: hole
-5a58e46082be047d0f13bee7974015b9
+daa100df6e6711906b61c9ab5aa16032
2. into allocated space
0: [0..7]: extent
1: [8..23]: hole
diff --git a/tests/xfs/252.out b/tests/xfs/252.out
index 539c8a4..47d9a4c 100644
--- a/tests/xfs/252.out
+++ b/tests/xfs/252.out
@@ -158,9 +158,7 @@ eecb7aa303d121835de05028751d301c
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
*
1. into a hole
-0: [0..7]: data
-1: [8..39]: hole
-5a58e46082be047d0f13bee7974015b9
+daa100df6e6711906b61c9ab5aa16032
2. into allocated space
0: [0..7]: data
1: [8..23]: hole
@@ -242,9 +240,7 @@ eecb7aa303d121835de05028751d301c
0000400 cdcd cdcd cdcd cdcd cdcd cdcd cdcd cdcd
*
1. into a hole
-0: [0..7]: data
-1: [8..39]: hole
-5a58e46082be047d0f13bee7974015b9
+daa100df6e6711906b61c9ab5aa16032
2. into allocated space
0: [0..7]: data
1: [8..23]: hole
--
1.8.4.rc3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 9+ messages in thread