Skip to contentSkip to conversation

xfsqa: make some tests work again, add xfs_fsr test

PATCH In review Dave Chinner 2 participants 10 messages Jan 12, 2010

lore
Share & tools
lore
#0 lore raw

cover xfsqa: make some tests work again, add xfs_fsr test

Enable the growfs test 104 and filter out the useless output, remove hacks from 073 to do with loop devices and filter the log size out in 206 to prevent failures with new mkfs binaries that allow large logs.

Also, add a simple xfs_fsr test to improve coverage in the test suite. That's not hard given we have only one test (042) that defragments only one file.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

PATCH 1/4 xfsqa: filter the fsstress seed output in 104

Otherwise it fails to match the golden output. Also add the test to the auto group so that it is run regularly now that the growfs problems are fixed.

---
 104   |    2 +-
 group |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
104 +1 -1
index 6dea1d3..5f18d08 100755
@@ -60,7 +60,7 @@ _stress_scratch()
 	procs=3
 	nops=1000
 	# -w ensures that the only ops are ones which cause write I/O
-	$FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID &
+	$FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID > /dev/null &
 }
 
 # real QA test starts here
group +1 -1
index 8d055a2..2c2e293 100644
@@ -210,7 +210,7 @@ prealloc
 101 udf
 102 udf
 103 metadata dir ioctl auto quick
-104 growfs ioctl prealloc
+104 growfs ioctl prealloc auto
 105 acl auto quick
 106 quota
 107 quota
Signature · 6 lines
1.6.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] xfsqa: filter the fsstress seed output in 104

Quoted 3 lines · Dave Chinner

Otherwise it fails to match the golden output. Also add the test to the auto group so that it is run regularly now that the growfs problems are fixed.

Well, they're not actually fixed yet, Alex still needs to push out your patches to the xfs tree :)

anyway, patch looks good,

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

PATCH 2/4 xfsqa: make unmounting loop devices in 073 work again

In reply to Dave Chinner

Loop devices are now created and destroyed on demand, and the existing hacks to do this no longer work. Remove them.

---
 073 |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
073 +1 -12
index 5059448..ac4c64f 100755
@@ -3,15 +3,6 @@
 #
 # Test xfs_copy
 #
-# HACK WARNING:
-#
-# Due to the severe brokenness of mount's handling of loopback devices, we
-# hardcode the loop devices we use for this test. This enables us to clean up
-# the pieces when we remount the loop device because mount loses all trace of
-# the fact this is a loop device. Hence to enable us to unmount the hosting
-# filesystem, we need to manually tear down the relevant loop device. If
-# mount ever gets fixed then this hack can be removed.
-#
 #-----------------------------------------------------------------------
 # Copyright (c) 2000-2003,2008 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -127,9 +118,7 @@ _verify_copy()
 	diff -u $tmp.geometry1 $tmp.geometry2
 
 	echo unmounting and removing new image
-	loop=`mount | grep $target | grep -o -e 'loop=.*[^),]' | grep -o -e '/.*$'`
-	umount $source $target
-	losetup -d $loop > /dev/null 2>&1
+	umount $source_dir $target_dir
 	rm -f $target
 }
 
Signature · 6 lines
1.6.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#4 lore raw

Re: [PATCH 2/4] xfsqa: make unmounting loop devices in 073 work again

Quoted 2 lines · Dave Chinner

Loop devices are now created and destroyed on demand, and the existing hacks to do this no longer work. Remove them.

Just noticed that I had not been running this test at all for a long time as it doesn't work with external logs.

Seems like the current code indeed fails reliably for me and this patch fixes it.

The only problem is that the loop device autodestruct features is only available since Linux 2.6.25 and also needs a recent util-linux. Is this old enough to simply go with the auto destruct version, or do we need to support either one?

What about the patch below? This adds the -d argument to the umount calls for the loop images, which destroys the loop images in older kernels and is a no-op for modern kernels that have the loop auto-destruct feature:

Loop devices are now created and destroyed on demand, and the existing hacks to do this no longer work. Remove them.

---
 073 |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
073 +2 -13
Index: xfstests-dev/073
===================================================================
@@ -3,15 +3,6 @@
 #
 # Test xfs_copy
 #
-# HACK WARNING:
-#
-# Due to the severe brokenness of mount's handling of loopback devices, we
-# hardcode the loop devices we use for this test. This enables us to clean up
-# the pieces when we remount the loop device because mount loses all trace of
-# the fact this is a loop device. Hence to enable us to unmount the hosting
-# filesystem, we need to manually tear down the relevant loop device. If
-# mount ever gets fixed then this hack can be removed.
-#
 #-----------------------------------------------------------------------
 # Copyright (c) 2000-2003,2008 Silicon Graphics, Inc.  All Rights Reserved.
 #
@@ -51,7 +42,7 @@ _cleanup()
 {
 	cd /
 	umount $SCRATCH_MNT 2>/dev/null
-	umount $imgs.loop 2>/dev/null
+	umount -d $imgs.loop 2>/dev/null
 	[ -d $imgs.loop ] && rmdir $imgs.loop
 	[ -d $imgs.source_dir ] && rm -rf $imgs.source_dir
 	rm -f $imgs.* $tmp.* /var/tmp/xfs_copy.log.*
@@ -127,9 +118,7 @@ _verify_copy()
 	diff -u $tmp.geometry1 $tmp.geometry2
 
 	echo unmounting and removing new image
-	loop=`mount | grep $target | grep -o -e 'loop=.*[^),]' | grep -o -e '/.*$'`
-	umount $source $target
-	losetup -d $loop > /dev/null 2>&1
+	umount -d $source_dir $target_dir
 	rm -f $target
 }
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw

Re: [PATCH 2/4] xfsqa: make unmounting loop devices in 073 work again

Quoted 15 lines · Christoph Hellwig
Quoted 2 lines · Dave Chinner

Loop devices are now created and destroyed on demand, and the existing hacks to do this no longer work. Remove them.

Just noticed that I had not been running this test at all for a long time as it doesn't work with external logs.

Seems like the current code indeed fails reliably for me and this patch fixes it.

The only problem is that the loop device autodestruct features is only available since Linux 2.6.25 and also needs a recent util-linux. Is this old enough to simply go with the auto destruct version, or do we need to support either one?

Quoted 4 lines

What about the patch below? This adds the -d argument to the umount calls for the loop images, which destroys the loop images in older kernels and is a no-op for modern kernels that have the loop auto-destruct feature:

Yes, that looks like a better way to solve the problem.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#6 lore raw

PATCH 3/4 xfsqa: filter log size in 206

In reply to Dave Chinner

With the log size now going past 128MB, test 206 creates a filesystem with a much larger log than 128MB. The golden output expects at 128MB log size, so the test breaks. Filter the log size out of the mkfs output and golden output so that the test works on both older and newer mkfs binaries.

---
 206     |    9 ++++++---
 206.out |    6 +++---
 2 files changed, 9 insertions(+), 6 deletions(-)
206 +6 -3
index b1b2286..0935335 100755
@@ -75,19 +75,22 @@ dd if=/dev/zero of=$tmpfile bs=1 seek=19998630180864 count=1 >/dev/null 2>&1 \
 # mkfs slightly smaller than that
 echo "=== mkfs.xfs ==="
 mkfs.xfs -f -bsize=4096 -dagsize=76288719b,size=3905982455b -llazy-count=0 $tmpfile \
-	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g"
+	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g" \
+		-e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/"
 
 mount -o loop $tmpfile $tmpdir || _fail "!!! failed to loopback mount"
 
 # see what happens when we growfs it
 echo "=== xfs_growfs ==="
 xfs_growfs $tmpdir \
-	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g"
+	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g" \
+		-e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/"
 
 # and double-check the new geometry
 echo "=== xfs_info ==="
 xfs_info $tmpdir \
-	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g"
+	| sed -e "s,^meta-data=.*isize,meta-data=FILE                   isize,g" \
+		-e "s/\(^log.*blocks=\)\([0-9]*,\)/\1XXXXX,/"
 
 # _cleanup cleans up for us
 
206.out +3 -3
index 57d4f4e..da70d01 100644
@@ -6,7 +6,7 @@ meta-data=FILE                   isize=256    agcount=52, agsize=76288719 blks
 data     =                       bsize=4096   blocks=3905982455, imaxpct=5
          =                       sunit=0      swidth=0 blks
 naming   =version 2              bsize=4096   ascii-ci=0
-log      =internal log           bsize=4096   blocks=32768, version=2
+log      =internal log           bsize=4096   blocks=XXXXX, version=2
          =                       sectsz=512   sunit=0 blks, lazy-count=0
 realtime =none                   extsz=4096   blocks=0, rtextents=0
 === xfs_growfs ===
@@ -15,7 +15,7 @@ meta-data=FILE                   isize=256    agcount=52, agsize=76288719 blks
 data     =                       bsize=4096   blocks=3905982455, imaxpct=5
          =                       sunit=0      swidth=0 blks
 naming   =version 2              bsize=4096   ascii-ci=0
-log      =internal               bsize=4096   blocks=32768, version=2
+log      =internal               bsize=4096   blocks=XXXXX, version=2
          =                       sectsz=512   sunit=0 blks, lazy-count=0
 realtime =none                   extsz=4096   blocks=0, rtextents=0
 data blocks changed from 3905982455 to 4882478016
@@ -25,6 +25,6 @@ meta-data=FILE                   isize=256    agcount=64, agsize=76288719 blks
 data     =                       bsize=4096   blocks=4882478016, imaxpct=5
          =                       sunit=0      swidth=0 blks
 naming   =version 2              bsize=4096   ascii-ci=0
-log      =internal               bsize=4096   blocks=32768, version=2
+log      =internal               bsize=4096   blocks=XXXXX, version=2
          =                       sectsz=512   sunit=0 blks, lazy-count=0
 realtime =none                   extsz=4096   blocks=0, rtextents=0
Signature · 6 lines
1.6.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 3/4
#7 lore raw

Re: [PATCH 3/4] xfsqa: filter log size in 206

Quoted 5 lines · Dave Chinner

With the log size now going past 128MB, test 206 creates a filesystem with a much larger log than 128MB. The golden output expects at 128MB log size, so the test breaks. Filter the log size out of the mkfs output and golden output so that the test works on both older and newer mkfs binaries.

I guess you'll need a large enough test filesystem to hit this so I don't see it, but it looks good,

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw

PATCH 4/4 xfsqa: add simple xfs_fsr test

In reply to Dave Chinner

We have very little fsr test coverage in the test suite right now. 042 is the only test that runs it, and it only defragments a single file.

Improve the coverage by simply running xfs_fsr of the test filesystem. This gives xfs_fsr a wide variety of inodes to try to defragment. A simple test like this would have tripped over the attr2 fork offset problems in the swap extents ioctl long ago thanks to the varied nature of inodes the test suite leaves around in this filesystem.

---
 221     |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 221.out |    2 ++
 group   |    1 +
 3 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 221
 create mode 100644 221.out
221 new file +57 -0
new file mode 100644
index 0000000..5fe5583
@@ -0,0 +1,57 @@
+#! /bin/sh
+# FS QA Test No. 221
+#
+# xfs_fsr QA tests
+# run xfs_fsr over the test filesystem to give it a wide and varied set of
+# inodes to try to defragment. This is effectively a crash/assert failure
+# test looking for corruption induced by xfs_fsr runs.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2010 Dave Chinner.  All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
[email protected]
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+_cleanup()
+{
+    rm -f $tmp.*
+}
+
+trap "_cleanup ; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+
+[ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found"
+
+xfs_fsr $TEST_MNT > /dev/null 2>&1
+
+echo "--- silence is golden ---"
+status=0 ; exit
221.out new file +2 -0
new file mode 100644
index 0000000..34b5d1b
@@ -0,0 +1,2 @@
+QA output created by 221
+--- silence is golden ---
group +1 -0
index 2c2e293..528f5e9 100644
@@ -330,3 +330,4 @@ prealloc
 218 auto fsr quick
 219 auto quota quick
 220 auto quota quick
+221 fsr ioctl auto quick
Signature · 6 lines
1.6.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 4/4
#9 lore raw

Re: [PATCH 4/4] xfsqa: add simple xfs_fsr test

Quoted 10 lines · Dave Chinner

We have very little fsr test coverage in the test suite right now. 042 is the only test that runs it, and it only defragments a single file.

Improve the coverage by simply running xfs_fsr of the test filesystem. This gives xfs_fsr a wide variety of inodes to try to defragment. A simple test like this would have tripped over the attr2 fork offset problems in the swap extents ioctl long ago thanks to the varied nature of inodes the test suite leaves around in this filesystem.

Looks good,

and having it after 200+ testcases also means it should have at least a bit of work to do.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs