]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/xfs: Do not append -a and -o options to metadump
authorChandan Babu R <chandanbabu@kernel.org>
Thu, 11 Jan 2024 11:58:25 +0000 (17:28 +0530)
committerZorro Lang <zlang@kernel.org>
Sun, 14 Jan 2024 12:39:09 +0000 (20:39 +0800)
xfs/253 requires the metadump to be obfuscated. However _xfs_metadump() would
append the '-o' option causing the metadump to be unobfuscated.

This commit fixes the bug by modifying _xfs_metadump() to no longer append any
metadump options. The direct/indirect callers of this function now pass the
required options explicitly.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/populate
common/xfs
tests/xfs/291
tests/xfs/336
tests/xfs/432
tests/xfs/503

index 3d233073c9c966eb1ce1315abe0043ebdc16c9c8..cfbfd88a7f98cffb9cec8d1571db0584ee22ab3f 100644 (file)
@@ -55,7 +55,7 @@ __populate_fail() {
        case "$FSTYP" in
        xfs)
                _scratch_unmount
-               _scratch_xfs_metadump "$metadump"
+               _scratch_xfs_metadump "$metadump" -a -o
                ;;
        ext4)
                _scratch_unmount
index f23e1e918788153ac0d2da41bc258fcbf038092c..91b8ac387c69649072ecf7d3dc54486feccaba2f 100644 (file)
@@ -677,7 +677,6 @@ _xfs_metadump() {
        local compressopt="$4"
        shift; shift; shift; shift
        local options="$@"
-       test -z "$options" && options="-a -o"
 
        if [ "$logdev" != "none" ]; then
                options="$options -l $logdev"
@@ -865,7 +864,7 @@ _check_xfs_filesystem()
        if [ "$ok" -ne 1 ] && [ "$DUMP_CORRUPT_FS" = "1" ]; then
                local flatdev="$(basename "$device")"
                _xfs_metadump "$seqres.$flatdev.check.md" "$device" "$logdev" \
-                       compress >> $seqres.full
+                       compress -a -o >> $seqres.full
        fi
 
        # Optionally test the index rebuilding behavior.
@@ -898,7 +897,7 @@ _check_xfs_filesystem()
                if [ "$rebuild_ok" -ne 1 ] && [ "$DUMP_CORRUPT_FS" = "1" ]; then
                        local flatdev="$(basename "$device")"
                        _xfs_metadump "$seqres.$flatdev.rebuild.md" "$device" \
-                               "$logdev" compress >> $seqres.full
+                               "$logdev" compress -a -o >> $seqres.full
                fi
        fi
 
@@ -982,7 +981,7 @@ _check_xfs_filesystem()
                if [ "$orebuild_ok" -ne 1 ] && [ "$DUMP_CORRUPT_FS" = "1" ]; then
                        local flatdev="$(basename "$device")"
                        _xfs_metadump "$seqres.$flatdev.orebuild.md" "$device" \
-                               "$logdev" compress >> $seqres.full
+                               "$logdev" compress -a -o >> $seqres.full
                fi
        fi
 
index 600dcb2eba8d9f70491f77da30be4c16596ff860..54448497cc29e135c023d3d4f8df6439599b57b8 100755 (executable)
@@ -92,7 +92,7 @@ _scratch_xfs_check >> $seqres.full 2>&1 || _fail "xfs_check failed"
 
 # Yes they can!  Now...
 # Can xfs_metadump cope with this monster?
-_scratch_xfs_metadump $tmp.metadump || _fail "xfs_metadump failed"
+_scratch_xfs_metadump $tmp.metadump -a -o || _fail "xfs_metadump failed"
 SCRATCH_DEV=$tmp.img _scratch_xfs_mdrestore $tmp.metadump || _fail "xfs_mdrestore failed"
 SCRATCH_DEV=$tmp.img _scratch_xfs_repair -f &>> $seqres.full || \
        _fail "xfs_repair of metadump failed"
index d7a074d971d1c748104aa08d062930d34c112811..43b3790cbb7cb40ab6906fe66ceed05305d4e8a1 100755 (executable)
@@ -62,7 +62,7 @@ _scratch_cycle_mount
 
 echo "Create metadump file"
 _scratch_unmount
-_scratch_xfs_metadump $metadump_file
+_scratch_xfs_metadump $metadump_file -a
 
 # Now restore the obfuscated one back and take a look around
 echo "Restore metadump"
index 66315b03987287ff458066c4aad6f65cd41dae55..dae68fb2dd90d5d49459b34349bc7a760fa5d32f 100755 (executable)
@@ -86,7 +86,7 @@ echo "qualifying extent: $extlen blocks" >> $seqres.full
 test -n "$extlen" || _notrun "could not create dir extent > 1000 blocks"
 
 echo "Try to metadump"
-_scratch_xfs_metadump $metadump_file -w
+_scratch_xfs_metadump $metadump_file -a -o -w
 SCRATCH_DEV=$metadump_img _scratch_xfs_mdrestore $metadump_file
 
 echo "Check restored metadump image"
index f5710ece35b85fb9468c95e3365e59f55f712ff6..8805632d4fcb820474d03e09bb20652c4ab8299b 100755 (executable)
@@ -46,7 +46,7 @@ metadump_file_ag=${metadump_file}.ag
 copy_file=$testdir/copy.img
 
 echo metadump
-_scratch_xfs_metadump $metadump_file >> $seqres.full
+_scratch_xfs_metadump $metadump_file -a -o >> $seqres.full
 
 echo metadump a
 _scratch_xfs_metadump $metadump_file_a -a >> $seqres.full