]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/{fuzzy,populate}: use _scratch_xfs_mdrestore
authorDarrick J. Wong <djwong@kernel.org>
Thu, 20 Feb 2025 21:47:05 +0000 (13:47 -0800)
committerZorro Lang <zlang@kernel.org>
Thu, 6 Mar 2025 13:25:55 +0000 (21:25 +0800)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/fuzzy
common/populate

index 702ebc4b9aed844cabdc99902338fe29b68913b2..ee9fe75609e6039b7bd2dba9f9e9c95078044908 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 627e8ca49694e7c2c6733c14cce3549936d298e1..e6804cbc6114ba19f541576606115a658905f65b 100644 (file)
@@ -1030,19 +1030,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}"