public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs/033: add golden output for CRC enaled filesystems
@ 2014-02-05  8:23 Dave Chinner
  2014-02-07 17:49 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2014-02-05  8:23 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

CRC enabled filesystems emit different errors on corruption.
Specifically, inode corruption is picked up much earlier due to
verifier failures (e.g. incorrect inode identifier) and so
xfs_repair throws errors sufficiently different that filtering
cannot hide the differences. Hence simply add a new golden output
file and link it appropriately once we know what type of filesystem
we are testing.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/filter               |   3 +
 tests/xfs/033               |  10 ++-
 tests/xfs/033.crc.out.linux | 197 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 207 insertions(+), 3 deletions(-)
 create mode 100644 tests/xfs/033.crc.out.linux

diff --git a/common/filter b/common/filter
index 04d12c4..bb7fb33 100644
--- a/common/filter
+++ b/common/filter
@@ -152,6 +152,9 @@ _filter_mkfs()
     if (/^\s+=\s+sectsz=(\d+)\s+attr=(\d+)/) {
         print STDERR "sectsz=$1\nattr=$2\n";
     }
+    if (/^\s+=\s+crc=(\d)/) {
+        print STDERR "crc=$1\n";
+    }
     if (/^data\s+=\s+bsize=(\d+)\s+blocks=(\d+), imaxpct=(\d+)/) {
 	print STDERR "dbsize=$1\ndblocks=$2\nimaxpct=$3\n";
 	print STDOUT "data     = bsize=XXX blocks=XXX, imaxpct=PCT\n";
diff --git a/tests/xfs/033 b/tests/xfs/033
index bf906e0..81ba3a0 100755
--- a/tests/xfs/033
+++ b/tests/xfs/033
@@ -45,9 +45,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 . ./common/filter
 . ./common/repair
 
-# link correct .out file
-_link_out_file $seq.out $seqfull.out
-
 # nuke the root, rt bitmap, and rt summary inodes
 # 
 _check_root_inos()
@@ -86,6 +83,13 @@ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
 [ $isize -lt 512 ] && \
 	_scratch_mkfs_xfs -isize=512 | _filter_mkfs >/dev/null 2>&1
 
+# link correct .out file
+if [ $crc -eq 1 ]; then
+	_link_out_file $seq.crc.out $seqfull.out
+else
+	_link_out_file $seq.out $seqfull.out
+fi
+
 `xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \
 	sed -e 's/ //g' -e 's/^/export /'`
 
diff --git a/tests/xfs/033.crc.out.linux b/tests/xfs/033.crc.out.linux
new file mode 100644
index 0000000..a6e86b9
--- /dev/null
+++ b/tests/xfs/033.crc.out.linux
@@ -0,0 +1,197 @@
+QA output created by 033
+meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
+data     = bsize=XXX blocks=XXX, imaxpct=PCT
+         = sunit=XXX swidth=XXX, unwritten=X
+naming   =VERN bsize=XXX
+log      =LDEV bsize=XXX blocks=XXX
+realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
+Corrupting root inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared root inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+root inode lost
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing root directory
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+resetting inode INO nlinks from 1 to 2
+done
+Corrupting rt bitmap inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared realtime bitmap inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime bitmap inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting rt summary inode - setting bits to 0
+Wrote X.XXKb (value 0x0)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0x0 on inode INO
+bad version number 0x0 on inode INO
+inode identifier 0 mismatch on inode INO
+bad magic number 0x0 on inode INO, resetting magic number
+bad version number 0x0 on inode INO, resetting version number
+inode identifier 0 mismatch on inode INO
+cleared realtime summary inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime summary inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting root inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared root inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+root inode lost
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing root directory
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+resetting inode INO nlinks from 1 to 2
+done
+Corrupting rt bitmap inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared realtime bitmap inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime bitmap inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
+Corrupting rt summary inode - setting bits to -1
+Wrote X.XXKb (value 0xffffffff)
+Phase 1 - find and verify superblock...
+Phase 2 - using <TYPEOF> log
+        - zero log...
+        - scan filesystem freespace and inode maps...
+        - found root inode chunk
+Phase 3 - for each AG...
+        - scan and clear agi unlinked lists...
+        - process known inodes and perform inode discovery...
+bad magic number 0xffff on inode INO
+bad version number 0xffffffff on inode INO
+inode identifier 18446744073709551615 mismatch on inode INO
+bad magic number 0xffff on inode INO, resetting magic number
+bad version number 0xffffffff on inode INO, resetting version number
+inode identifier 18446744073709551615 mismatch on inode INO
+cleared realtime summary inode INO
+        - process newly discovered inodes...
+Phase 4 - check for duplicate blocks...
+        - setting up duplicate extent list...
+        - check for inodes claiming duplicate blocks...
+Phase 5 - rebuild AG headers and trees...
+        - reset superblock...
+Phase 6 - check inode connectivity...
+reinitializing realtime summary inode
+        - resetting contents of realtime bitmap and summary inodes
+        - traversing filesystem ...
+        - traversal finished ...
+        - moving disconnected inodes to lost+found ...
+Phase 7 - verify and correct link counts...
+done
-- 
1.8.4.rc3

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs/033: add golden output for CRC enaled filesystems
  2014-02-05  8:23 [PATCH] xfs/033: add golden output for CRC enaled filesystems Dave Chinner
@ 2014-02-07 17:49 ` Christoph Hellwig
  2014-02-10  1:51   ` Dave Chinner
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2014-02-07 17:49 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Wed, Feb 05, 2014 at 07:23:10PM +1100, Dave Chinner wrote:
> diff --git a/common/filter b/common/filter
> index 04d12c4..bb7fb33 100644
> --- a/common/filter
> +++ b/common/filter
> @@ -152,6 +152,9 @@ _filter_mkfs()
>      if (/^\s+=\s+sectsz=(\d+)\s+attr=(\d+)/) {
>          print STDERR "sectsz=$1\nattr=$2\n";
>      }
> +    if (/^\s+=\s+crc=(\d)/) {
> +        print STDERR "crc=$1\n";
> +    }

I think this variable is named way to genericly.  And that probably
applies to others as well.

I'd suggest at least xfs_feature_crc or similar.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs/033: add golden output for CRC enaled filesystems
  2014-02-07 17:49 ` Christoph Hellwig
@ 2014-02-10  1:51   ` Dave Chinner
  2014-02-10 10:44     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2014-02-10  1:51 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Fri, Feb 07, 2014 at 09:49:50AM -0800, Christoph Hellwig wrote:
> On Wed, Feb 05, 2014 at 07:23:10PM +1100, Dave Chinner wrote:
> > diff --git a/common/filter b/common/filter
> > index 04d12c4..bb7fb33 100644
> > --- a/common/filter
> > +++ b/common/filter
> > @@ -152,6 +152,9 @@ _filter_mkfs()
> >      if (/^\s+=\s+sectsz=(\d+)\s+attr=(\d+)/) {
> >          print STDERR "sectsz=$1\nattr=$2\n";
> >      }
> > +    if (/^\s+=\s+crc=(\d)/) {
> > +        print STDERR "crc=$1\n";
> > +    }
> 
> I think this variable is named way to genericly.  And that probably
> applies to others as well.
> 
> I'd suggest at least xfs_feature_crc or similar.

I can't say I like adding that prefix to the mkfs varaibles. I'll
change this one to something less generic, but I'm going to ignore
the others right now because changing them involves modifying 30+
tests....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs/033: add golden output for CRC enaled filesystems
  2014-02-10  1:51   ` Dave Chinner
@ 2014-02-10 10:44     ` Christoph Hellwig
  2014-02-10 10:55       ` Dave Chinner
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2014-02-10 10:44 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Christoph Hellwig, xfs

On Mon, Feb 10, 2014 at 12:51:05PM +1100, Dave Chinner wrote:
> I can't say I like adding that prefix to the mkfs varaibles. I'll
> change this one to something less generic, but I'm going to ignore
> the others right now because changing them involves modifying 30+
> tests....

In that case let's keep the crc one without prefix for now.  But I think
introducing very generic variables into the environment implicitly is
a bad idea and will bite us long term.

Reluctantly:

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] 5+ messages in thread

* Re: [PATCH] xfs/033: add golden output for CRC enaled filesystems
  2014-02-10 10:44     ` Christoph Hellwig
@ 2014-02-10 10:55       ` Dave Chinner
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Chinner @ 2014-02-10 10:55 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Mon, Feb 10, 2014 at 02:44:26AM -0800, Christoph Hellwig wrote:
> On Mon, Feb 10, 2014 at 12:51:05PM +1100, Dave Chinner wrote:
> > I can't say I like adding that prefix to the mkfs varaibles. I'll
> > change this one to something less generic, but I'm going to ignore
> > the others right now because changing them involves modifying 30+
> > tests....
> 
> In that case let's keep the crc one without prefix for now.  But I think
> introducing very generic variables into the environment implicitly is
> a bad idea and will bite us long term.
> 
> Reluctantly:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

I renamed it earlier this afternoon to "_fs_has_crc" so that code
that checks it makes sense when you read it:

	if [ $_fs_has_crc -eq 1 ]; then
		.....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-10 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-05  8:23 [PATCH] xfs/033: add golden output for CRC enaled filesystems Dave Chinner
2014-02-07 17:49 ` Christoph Hellwig
2014-02-10  1:51   ` Dave Chinner
2014-02-10 10:44     ` Christoph Hellwig
2014-02-10 10:55       ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox