]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
common/{fuzzy,populate}: use _scratch_xfs_mdrestore
authorDarrick J. Wong <djwong@kernel.org>
Tue, 6 Feb 2024 00:06:40 +0000 (16:06 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 1 Nov 2024 20:41:57 +0000 (13:41 -0700)
Port the fuzzing and populated filesystem cache code to use this helper
to pick up external log devices for the scratch filesystem.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
common/fuzzy
common/populate

index 14d6cb104aaf5796c4b211927980dbc34fbfbd25..73e5cd2a54445586fab5898a9718dfe82809d10d 100644 (file)
@@ -306,7 +306,7 @@ __scratch_xfs_fuzz_unmount()
 __scratch_xfs_fuzz_mdrestore()
 {
        __scratch_xfs_fuzz_unmount
-       _xfs_mdrestore "${POPULATE_METADUMP}" "${SCRATCH_DEV}" || \
+       _scratch_xfs_mdrestore "${POPULATE_METADUMP}" || \
                _fail "${POPULATE_METADUMP}: Could not find metadump to restore?"
 }
 
index 82f526dcf9e2d599f32c39e908f71745c91e8680..94ee7af9ba1c95eb0656873d2df4d2a4f52d2065 100644 (file)
@@ -1017,19 +1017,8 @@ _scratch_populate_restore_cached() {
 
        case "${FSTYP}" in
        "xfs")
-               _xfs_mdrestore "${metadump}" "${SCRATCH_DEV}"
-               res=$?
-               test $res -ne 0 && return $res
-
-               # Cached images should have been unmounted cleanly, so if
-               # there's an external log we need to wipe it and run repair to
-               # format it to match this filesystem.
-               if [ -n "${SCRATCH_LOGDEV}" ]; then
-                       $WIPEFS_PROG -a "${SCRATCH_LOGDEV}"
-                       _scratch_xfs_repair
-                       res=$?
-               fi
-               return $res
+               _scratch_xfs_mdrestore "${metadump}"
+               return $?
                ;;
        "ext2"|"ext3"|"ext4")
                _ext4_mdrestore "${metadump}" "${SCRATCH_DEV}"