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>
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
+}
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}"
# 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"