xfs/021: filter v5 filesystem metadata
authorDave Chinner <dchinner@redhat.com>
Tue, 18 Feb 2014 06:16:34 +0000 (17:16 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 18 Feb 2014 06:16:34 +0000 (17:16 +1100)
The xfs_db output is different for v5 filesystem metadata, and so
the test fails due to golden image mismatches rather than an actual
test failure. Improve the filter to hide the differences between the
metadata format outputs.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/xfs/021

index a727b51c6e8214140117ee82a111fdc494a65f87..a5480927e363e5d27a5bfeab43d182f793c97965 100755 (executable)
@@ -135,10 +135,19 @@ xfs_db -r -c "inode $inum_1" -c "print a.sfattr" $SCRATCH_DEV | \
 
 echo "*** dump attributes (2)"
 
+# There is a fair bit of filtering here to convert v5 filesystem output
+# into the v4 format that holds the meaningful information for the test.
 xfs_db -r -c "inode $inum_2" -c "a a.bmx[0].startblock" -c print $SCRATCH_DEV \
        | perl -ne '
 s/,secure//;
 s/,parent//;
+s/info.hdr/info/;
+/hdr.info.crc/ && next;
+/hdr.info.bno/ && next;
+/hdr.info.uuid/ && next;
+/hdr.info.lsn/ && next;
+/hdr.info.owner/ && next;
+s/^(hdr.info.magic =) 0x3bee/\1 0xfbee/;
 s/^(hdr.firstused =) (\d+)/\1 FIRSTUSED/;
 s/^(hdr.freemap\[0-2] = \[base,size]).*/\1 [FREEMAP..]/;
 s/^(entries\[0-2] = \[hashval,nameidx,incomplete,root,local]).*/\1 [ENTRIES..]/;