* [PATCH 0/3] xfstests: improvements for generic/204
@ 2013-09-03 0:14 Dave Chinner
2013-09-03 0:14 ` [PATCH 1/3] xfstests: generic/204 should call _check_scratch_fs Dave Chinner
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Dave Chinner @ 2013-09-03 0:14 UTC (permalink / raw)
To: xfs
Hi folks,
These patches are fixes and improvements for generic/204.
Firstly, it doesn't check the filesystem it works on, and so
corruptions can go undetected. Secondly, _scratch_mkfs_sized doesn't
handle different block sizes passed in on the command line via
MKFS_OPTIONS at all well (i.e they get ignored) and so it has never
run on small block size filesystems of any type.
Finally, make it run on filesystems with different block sizes and
inode sizes by scaling the file count appropriately. It detects
block and inode size from the output of mkfs, so scaling only occurs
if the underlying filesystem emits them.
Cheers,
Dave.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] xfstests: generic/204 should call _check_scratch_fs
2013-09-03 0:14 [PATCH 0/3] xfstests: improvements for generic/204 Dave Chinner
@ 2013-09-03 0:14 ` Dave Chinner
2013-09-03 7:33 ` Christoph Hellwig
2013-09-03 0:14 ` [PATCH 2/3] xfstests: Obey mkfs options for sized filesystems on XFS Dave Chinner
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Dave Chinner @ 2013-09-03 0:14 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
Because if it corrupts the filesystem it currently goes undetected.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
tests/generic/204 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/generic/204 b/tests/generic/204
index 62bd248..98cb176 100755
--- a/tests/generic/204
+++ b/tests/generic/204
@@ -52,6 +52,8 @@ for i in `seq 1 22500`; do
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
done
+_check_scratch_fs
+
# success, all done
echo "*** done"
rm -f $seqres.full
--
1.8.3.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] xfstests: Obey mkfs options for sized filesystems on XFS
2013-09-03 0:14 [PATCH 0/3] xfstests: improvements for generic/204 Dave Chinner
2013-09-03 0:14 ` [PATCH 1/3] xfstests: generic/204 should call _check_scratch_fs Dave Chinner
@ 2013-09-03 0:14 ` Dave Chinner
2013-09-03 7:34 ` Christoph Hellwig
2013-09-03 0:14 ` [PATCH 3/3] xfstests: Make 204 work with different block and inode sizes Dave Chinner
2013-10-14 13:09 ` [PATCH 0/3] xfstests: improvements for generic/204 Rich Johnston
3 siblings, 1 reply; 8+ messages in thread
From: Dave Chinner @ 2013-09-03 0:14 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
The XFS implementation of _scratch_mkfs_sized ignores MKFS_OPTIONS
when a custom block size is set and so isn't testing things like
CRCs on such sized filesytsems. Fix this by ensuring we don't try to
override the block size is it is set in MKFS_OPTIONS. xfs/204 shows
this problem.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
common/rc | 8 +++++++-
tests/generic/204 | 4 +++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/common/rc b/common/rc
index 358f24b..8a239c5 100644
--- a/common/rc
+++ b/common/rc
@@ -578,7 +578,13 @@ _scratch_mkfs_sized()
case $FSTYP in
xfs)
- _scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
+ # don't override MKFS_OPTIONS that set a block size.
+ echo $MKFS_OPTIONS |egrep -q "b?size="
+ if [ $? -eq 0 ]; then
+ _scratch_mkfs_xfs -d size=$fssize
+ else
+ _scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
+ fi
;;
ext2|ext3|ext4|ext4dev)
yes | ${MKFS_PROG}.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
diff --git a/tests/generic/204 b/tests/generic/204
index 98cb176..a054c8f 100755
--- a/tests/generic/204
+++ b/tests/generic/204
@@ -39,13 +39,15 @@ _supported_os Linux
_require_scratch
+rm -f $seqres.full
+
SIZE=`expr 104 \* 1024 \* 1024`
_scratch_mkfs_sized $SIZE &> /dev/null
_scratch_mount
# fix the reserve block pool to a known size so that the enospc calculations
# work out correctly.
-_scratch_resvblks 1024 > $seqres.full 2>&1
+_scratch_resvblks 1024 >> $seqres.full 2>&1
for i in `seq 1 22500`; do
echo -n > $SCRATCH_MNT/$i
--
1.8.3.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] xfstests: Make 204 work with different block and inode sizes.
2013-09-03 0:14 [PATCH 0/3] xfstests: improvements for generic/204 Dave Chinner
2013-09-03 0:14 ` [PATCH 1/3] xfstests: generic/204 should call _check_scratch_fs Dave Chinner
2013-09-03 0:14 ` [PATCH 2/3] xfstests: Obey mkfs options for sized filesystems on XFS Dave Chinner
@ 2013-09-03 0:14 ` Dave Chinner
2013-10-14 13:10 ` Rich Johnston
2013-10-14 13:09 ` [PATCH 0/3] xfstests: improvements for generic/204 Rich Johnston
3 siblings, 1 reply; 8+ messages in thread
From: Dave Chinner @ 2013-09-03 0:14 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
Otherwise it fails with ENOSPC on CRC enabled filesystems because
ofhte larger inode size.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
common/filter | 10 +++++++++-
tests/generic/204 | 34 ++++++++++++++++++++++++++++++----
2 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/common/filter b/common/filter
index ee738ca..dc9e197 100644
--- a/common/filter
+++ b/common/filter
@@ -131,9 +131,17 @@ _filter_date()
}
# prints filtered output on stdout, values (use eval) on stderr
-#
+# Non XFS filesystems always return a 4k block size and a 256 byte inode.
_filter_mkfs()
{
+ case $FSTYP in
+ xfs)
+ ;;
+ *)
+ perl -e 'print STDERR "dbsize=4096\nisize=256\n"'
+ return ;;
+ esac
+
set -
perl -ne '
if (/^meta-data=([\w,|\/.-]+)\s+isize=(\d+)\s+agcount=(\d+), agsize=(\d+) blks/) {
diff --git a/tests/generic/204 b/tests/generic/204
index a054c8f..598b805 100755
--- a/tests/generic/204
+++ b/tests/generic/204
@@ -28,6 +28,12 @@ echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ rm -f $tmp.*
+}
# get standard environment, filters and checks
. ./common/rc
@@ -41,15 +47,35 @@ _require_scratch
rm -f $seqres.full
+# get the block size first
+_scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null
+. $tmp.mkfs
+
SIZE=`expr 104 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE &> /dev/null
+_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null \
+ | _filter_mkfs 2> $tmp.mkfs > /dev/null
_scratch_mount
+. $tmp.mkfs
+
# fix the reserve block pool to a known size so that the enospc calculations
-# work out correctly.
-_scratch_resvblks 1024 >> $seqres.full 2>&1
+# work out correctly. Space usages is based 22500 files and 1024 reserved blocks
+# on a 4k block size 256 byte inode size filesystem.
+resv_blks=1024
+space=97920000
+
+# decrease files for inode size.
+# 22500 * (256 + 4k) = ~97MB
+# files * (isize + bsize) = 97MB
+# files = (97920000 / (isize + bsize))
+
+files=$((space / (isize + dbsize)))
+resv_blks=$((resv_blks * (4096 / dbsize)))
+
+echo files $files, resvblks $resv_blks >> $seqres.full
+_scratch_resvblks $resv_blks >> $seqres.full 2>&1
-for i in `seq 1 22500`; do
+for i in `seq 1 $files`; do
echo -n > $SCRATCH_MNT/$i
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
done
--
1.8.3.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] xfstests: generic/204 should call _check_scratch_fs
2013-09-03 0:14 ` [PATCH 1/3] xfstests: generic/204 should call _check_scratch_fs Dave Chinner
@ 2013-09-03 7:33 ` Christoph Hellwig
0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2013-09-03 7:33 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] xfstests: Obey mkfs options for sized filesystems on XFS
2013-09-03 0:14 ` [PATCH 2/3] xfstests: Obey mkfs options for sized filesystems on XFS Dave Chinner
@ 2013-09-03 7:34 ` Christoph Hellwig
0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2013-09-03 7:34 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
On Tue, Sep 03, 2013 at 10:14:54AM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> The XFS implementation of _scratch_mkfs_sized ignores MKFS_OPTIONS
> when a custom block size is set and so isn't testing things like
> CRCs on such sized filesytsems. Fix this by ensuring we don't try to
> override the block size is it is set in MKFS_OPTIONS. xfs/204 shows
> this problem.
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
Looks good.
Maybe someone more familar with the other mkfs tools should cross-check
those as well.
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/3] xfstests: improvements for generic/204
2013-09-03 0:14 [PATCH 0/3] xfstests: improvements for generic/204 Dave Chinner
` (2 preceding siblings ...)
2013-09-03 0:14 ` [PATCH 3/3] xfstests: Make 204 work with different block and inode sizes Dave Chinner
@ 2013-10-14 13:09 ` Rich Johnston
3 siblings, 0 replies; 8+ messages in thread
From: Rich Johnston @ 2013-10-14 13:09 UTC (permalink / raw)
To: Dave Chinner, xfs
On 09/02/2013 07:14 PM, Dave Chinner wrote:
> Hi folks,
>
> These patches are fixes and improvements for generic/204.
>
> Firstly, it doesn't check the filesystem it works on, and so
> corruptions can go undetected. Secondly, _scratch_mkfs_sized doesn't
> handle different block sizes passed in on the command line via
> MKFS_OPTIONS at all well (i.e they get ignored) and so it has never
> run on small block size filesystems of any type.
>
> Finally, make it run on filesystems with different block sizes and
> inode sizes by scaling the file count appropriately. It detects
> block and inode size from the output of mkfs, so scaling only occurs
> if the underlying filesystem emits them.
>
> Cheers,
>
> Dave.
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
This series has been commited.
Thanks
--Rich
commit a4d5b247b565307c7da05d7bf784f093ba3f5dad
Author: Dave Chinner <dchinner@redhat.com>
Date: Tue Sep 3 00:14:55 2013 +0000
xfstests: Make 204 work with different block and inode sizes.
commit f7433693f4198153900081dca01ab5cd940986b8
Author: Dave Chinner <dchinner@redhat.com>
Date: Tue Sep 3 00:14:54 2013 +0000
xfstests: Obey mkfs options for sized filesystems on XFS
commit f33d180335f13407df92c0dd642974a808d6b87f
Author: Dave Chinner <dchinner@redhat.com>
Date: Tue Sep 3 00:14:53 2013 +0000
xfstests: generic/204 should call _check_scratch_fs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] xfstests: Make 204 work with different block and inode sizes.
2013-09-03 0:14 ` [PATCH 3/3] xfstests: Make 204 work with different block and inode sizes Dave Chinner
@ 2013-10-14 13:10 ` Rich Johnston
0 siblings, 0 replies; 8+ messages in thread
From: Rich Johnston @ 2013-10-14 13:10 UTC (permalink / raw)
To: Dave Chinner, xfs
Looks good.
--Rich
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-10-14 13:10 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-03 0:14 [PATCH 0/3] xfstests: improvements for generic/204 Dave Chinner
2013-09-03 0:14 ` [PATCH 1/3] xfstests: generic/204 should call _check_scratch_fs Dave Chinner
2013-09-03 7:33 ` Christoph Hellwig
2013-09-03 0:14 ` [PATCH 2/3] xfstests: Obey mkfs options for sized filesystems on XFS Dave Chinner
2013-09-03 7:34 ` Christoph Hellwig
2013-09-03 0:14 ` [PATCH 3/3] xfstests: Make 204 work with different block and inode sizes Dave Chinner
2013-10-14 13:10 ` Rich Johnston
2013-10-14 13:09 ` [PATCH 0/3] xfstests: improvements for generic/204 Rich Johnston
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.