xfs: support xfs_metadump with external logs
authorDave Chinner <dchinner@redhat.com>
Mon, 20 Jan 2014 06:22:35 +0000 (06:22 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 22 Jan 2014 13:21:19 +0000 (07:21 -0600)
When running xfstests with an external log, the metadump tests fail
with extra output like:

    +filesystem is marked as having an external log; specify logdev on the mount command line.
    +xfs_metadump: cannot read superblock for ag 0

Add a _scratch_metadump() function to handle different logdev
configurations automatically for metadump.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common/rc
tests/xfs/253
tests/xfs/291

index d497818f21430db0751125e62623063d056d88a8..49c86dec18ccd69082fd6a8b17369bf3d15b2be5 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -317,6 +317,16 @@ _scratch_mkfs_options()
     echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
 }
 
     echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
 }
 
+_scratch_metadump()
+{
+       dumpfile=$1
+       options=
+
+       [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+               options="-l $SCRATCH_LOGDEV"
+
+       xfs_metadump $options $SCRATCH_DEV $dumpfile
+}
 
 _setup_large_xfs_fs()
 {
 
 _setup_large_xfs_fs()
 {
index f491ef4a3231051a7b00e984ce80896e38a7321e..4119794286662d23d1e91c44d28facbb0dcaaa71 100755 (executable)
@@ -171,8 +171,7 @@ ls -R | od -c >> $seqres.full
 cd $here
 
 _scratch_unmount
 cd $here
 
 _scratch_unmount
-
-xfs_metadump -f "${SCRATCH_DEV}" "${METADUMP_FILE}"
+_scratch_metadump $METADUMP_FILE
 
 # Now restore the obfuscated one back and take a look around
 xfs_mdrestore "${METADUMP_FILE}" "${SCRATCH_DEV}"
 
 # Now restore the obfuscated one back and take a look around
 xfs_mdrestore "${METADUMP_FILE}" "${SCRATCH_DEV}"
index 03c4de9cdbc8610da3d46836dfcdbd968b57ce81..d5a9b0835a3ee7ba81af93f172f6a353b31fc1e6 100755 (executable)
@@ -117,7 +117,7 @@ _xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
 
 # Yes they can!  Now...
 # Can xfs_metadump cope with this monster?
 
 # Yes they can!  Now...
 # Can xfs_metadump cope with this monster?
-xfs_metadump $SCRATCH_DEV $tmp.metadump || _fail "xfs_metadump failed"
+_scratch_metadump $tmp.metadump || _fail "xfs_metadump failed"
 xfs_mdrestore $tmp.metadump $tmp.img || _fail "xfs_mdrestore failed"
 xfs_repair $tmp.img >> $seqres.full 2>&1 || _fail "xfs_repair of metadump failed"
 
 xfs_mdrestore $tmp.metadump $tmp.img || _fail "xfs_mdrestore failed"
 xfs_repair $tmp.img >> $seqres.full 2>&1 || _fail "xfs_repair of metadump failed"