]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fuzzy: make freezing optional for scrub stress tests
authorDarrick J. Wong <djwong@kernel.org>
Fri, 30 Dec 2022 22:12:54 +0000 (14:12 -0800)
committerZorro Lang <zlang@kernel.org>
Sat, 14 Jan 2023 13:52:47 +0000 (21:52 +0800)
Make the freeze/thaw loop optional, since that's a significant change in
behavior if it's enabled.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/fuzzy
tests/xfs/422

index 0f6fc91b804f6355de2406e79c2dedaf0f71488f..219dd3bb0ace6fcc568c19fec73fc77382a25c4d 100644 (file)
@@ -499,6 +499,8 @@ __stress_scrub_check_commands() {
 #
 # Various options include:
 #
+# -f   Run a freeze/thaw loop while we're doing other things.  Defaults to
+#      disabled, unless XFS_SCRUB_STRESS_FREEZE is set.
 # -s   Pass this command to xfs_io to test scrub.  If zero -s options are
 #      specified, xfs_io will not be run.
 # -t   Run online scrub against this file; $SCRATCH_MNT is the default.
@@ -506,14 +508,16 @@ _scratch_xfs_stress_scrub() {
        local one_scrub_args=()
        local scrub_tgt="$SCRATCH_MNT"
        local runningfile="$tmp.fsstress"
+       local freeze="${XFS_SCRUB_STRESS_FREEZE}"
 
        __SCRUB_STRESS_FREEZE_PID=""
        rm -f "$runningfile"
        touch "$runningfile"
 
        OPTIND=1
-       while getopts "s:t:" c; do
+       while getopts "fs:t:" c; do
                case "$c" in
+                       f) freeze=yes;;
                        s) one_scrub_args+=("$OPTARG");;
                        t) scrub_tgt="$OPTARG";;
                        *) return 1; ;;
@@ -529,8 +533,11 @@ _scratch_xfs_stress_scrub() {
                   "ending at $(date --date="@${end}")" >> $seqres.full
 
        __stress_scrub_fsstress_loop "$end" "$runningfile" &
-       __stress_scrub_freeze_loop "$end" "$runningfile" &
-       __SCRUB_STRESS_FREEZE_PID="$!"
+
+       if [ -n "$freeze" ]; then
+               __stress_scrub_freeze_loop "$end" "$runningfile" &
+               __SCRUB_STRESS_FREEZE_PID="$!"
+       fi
 
        if [ "${#one_scrub_args[@]}" -gt 0 ]; then
                __stress_one_scrub_loop "$end" "$runningfile" "$scrub_tgt" \
index faea5d67928cb1b2467e6d2c5c0e353b3d2b3ac7..ac88713257c8d5b169b1eba69a19b5d36efd657b 100755 (executable)
@@ -31,7 +31,7 @@ _require_xfs_stress_online_repair
 _scratch_mkfs > "$seqres.full" 2>&1
 _scratch_mount
 _require_xfs_has_feature "$SCRATCH_MNT" rmapbt
-_scratch_xfs_stress_online_repair -s "repair rmapbt 0" -s "repair rmapbt 1"
+_scratch_xfs_stress_online_repair -f -s "repair rmapbt 0" -s "repair rmapbt 1"
 
 # success, all done
 echo Silence is golden