xfs
[Top] [All Lists]

[PATCH 5/7] xfs: support xfs_metadump with external logs

To: xfs@xxxxxxxxxxx
Subject: [PATCH 5/7] xfs: support xfs_metadump with external logs
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 20 Jan 2014 17:22:35 +1100
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1390198957-17184-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1390198957-17184-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 common/rc     | 10 ++++++++++
 tests/xfs/253 |  3 +--
 tests/xfs/291 |  2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/rc b/common/rc
index d497818..49c86de 100644
--- a/common/rc
+++ b/common/rc
@@ -317,6 +317,16 @@ _scratch_mkfs_options()
     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()
 {
diff --git a/tests/xfs/253 b/tests/xfs/253
index f491ef4..4119794 100755
--- a/tests/xfs/253
+++ b/tests/xfs/253
@@ -171,8 +171,7 @@ ls -R | od -c >> $seqres.full
 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}"
diff --git a/tests/xfs/291 b/tests/xfs/291
index 03c4de9..d5a9b08 100755
--- a/tests/xfs/291
+++ b/tests/xfs/291
@@ -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?
-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"
 
-- 
1.8.4.rc3

<Prev in Thread] Current Thread [Next in Thread>