* [PATCH] xfstests: add test 199, bad_features2 correction
@ 2009-01-03 20:53 Christoph Hellwig
2009-01-10 20:29 ` Eric Sandeen
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2009-01-03 20:53 UTC (permalink / raw)
To: xfs
Index: xfstests-dev/199
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ xfstests-dev/199 2009-01-03 20:36:06.000000000 +0000
@@ -0,0 +1,65 @@
+#! /bin/sh
+# FS QA Test No. 199
+#
+# Check that a filesystem first mounted read-only and then remounted
+# performs the features2 fixup properly.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2008 Christoph Hellwig.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=hch@lst.de
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+_cleanup()
+{
+ cd /
+ umount $SCRATCH_MNT >/dev/null 2>&1
+}
+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
+
+_require_scratch
+
+_scratch_mkfs_xfs >/dev/null 2>&1
+
+#
+# Print the current flags. Just a dummy so that the test breaks
+# in an obvious way when the default feature flags changed in mkfs
+#
+echo "Default feature2 flags:"
+xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
+xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print bad_features2'
+
+#
+# Now clear the normal flags
+#
+echo "Clearing features2:"
+xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
+
+#
+# And print the flags after a mount ro and remount rw
+_scratch_mount -o ro
+_scratch_mount -o remount,rw
+umount $SCRATCH_MNT
+echo "Features 2 after mount ro and remount rw:"
+xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
Index: xfstests-dev/group
===================================================================
--- xfstests-dev.orig/group 2009-01-03 20:24:09.000000000 +0000
+++ xfstests-dev/group 2009-01-03 20:24:48.000000000 +0000
@@ -300,3 +300,4 @@
195 ioctl dump auto
196 quota auto
197 dir auto
+199 mount auto
Index: xfstests-dev/199.out
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ xfstests-dev/199.out 2009-01-03 20:46:08.000000000 +0000
@@ -0,0 +1,9 @@
+QA output created by 199
+Default feature2 flags:
+features2 = 0x8
+bad_features2 = 0x8
+Clearing features2:
+features2 = 0
+Features 2 after mount ro and remount rw:
+features2 = 0x8
+*** done
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] xfstests: add test 199, bad_features2 correction
2009-01-03 20:53 [PATCH] xfstests: add test 199, bad_features2 correction Christoph Hellwig
@ 2009-01-10 20:29 ` Eric Sandeen
2009-01-10 20:33 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2009-01-10 20:29 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Christoph Hellwig wrote:
> Index: xfstests-dev/199
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ xfstests-dev/199 2009-01-03 20:36:06.000000000 +0000
> @@ -0,0 +1,65 @@
> +#! /bin/sh
> +# FS QA Test No. 199
> +#
> +# Check that a filesystem first mounted read-only and then remounted
> +# performs the features2 fixup properly.
Seems fine. Would it be worth adding a few more lines to also test that
a simple rw mount (w/o going through ro first) also properly fixes it?
-Eric
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2008 Christoph Hellwig.
> +#-----------------------------------------------------------------------
> +#
> +# creator
> +owner=hch@lst.de
> +
> +seq=`basename $0`
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1 # failure is the default!
> +
> +_cleanup()
> +{
> + cd /
> + umount $SCRATCH_MNT >/dev/null 2>&1
> +}
> +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
> +
> +_require_scratch
> +
> +_scratch_mkfs_xfs >/dev/null 2>&1
> +
> +#
> +# Print the current flags. Just a dummy so that the test breaks
> +# in an obvious way when the default feature flags changed in mkfs
> +#
> +echo "Default feature2 flags:"
> +xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
> +xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print bad_features2'
> +
> +#
> +# Now clear the normal flags
> +#
> +echo "Clearing features2:"
> +xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
> +
> +#
> +# And print the flags after a mount ro and remount rw
> +_scratch_mount -o ro
> +_scratch_mount -o remount,rw
> +umount $SCRATCH_MNT
> +echo "Features 2 after mount ro and remount rw:"
> +xfs_db -x $SCRATCH_DEV -c 'sb' -c 'print features2'
> +
> +# success, all done
> +echo "*** done"
> +rm -f $seq.full
> +status=0
> Index: xfstests-dev/group
> ===================================================================
> --- xfstests-dev.orig/group 2009-01-03 20:24:09.000000000 +0000
> +++ xfstests-dev/group 2009-01-03 20:24:48.000000000 +0000
> @@ -300,3 +300,4 @@
> 195 ioctl dump auto
> 196 quota auto
> 197 dir auto
> +199 mount auto
> Index: xfstests-dev/199.out
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ xfstests-dev/199.out 2009-01-03 20:46:08.000000000 +0000
> @@ -0,0 +1,9 @@
> +QA output created by 199
> +Default feature2 flags:
> +features2 = 0x8
> +bad_features2 = 0x8
> +Clearing features2:
> +features2 = 0
> +Features 2 after mount ro and remount rw:
> +features2 = 0x8
> +*** done
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] xfstests: add test 199, bad_features2 correction
2009-01-10 20:29 ` Eric Sandeen
@ 2009-01-10 20:33 ` Christoph Hellwig
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2009-01-10 20:33 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Christoph Hellwig, xfs
On Sat, Jan 10, 2009 at 02:29:50PM -0600, Eric Sandeen wrote:
> Christoph Hellwig wrote:
> > Index: xfstests-dev/199
> > ===================================================================
> > --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> > +++ xfstests-dev/199 2009-01-03 20:36:06.000000000 +0000
> > @@ -0,0 +1,65 @@
> > +#! /bin/sh
> > +# FS QA Test No. 199
> > +#
> > +# Check that a filesystem first mounted read-only and then remounted
> > +# performs the features2 fixup properly.
>
> Seems fine. Would it be worth adding a few more lines to also test that
> a simple rw mount (w/o going through ro first) also properly fixes it?
I was under the impression that we already tested that somewhere else,
but it seems like we don't. Yes, I'll add it, that's a good one.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-10 23:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-03 20:53 [PATCH] xfstests: add test 199, bad_features2 correction Christoph Hellwig
2009-01-10 20:29 ` Eric Sandeen
2009-01-10 20:33 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox