From: Darrick J. Wong Date: Fri, 30 Dec 2022 22:12:54 +0000 (-0800) Subject: fuzzy: make freezing optional for scrub stress tests X-Git-Tag: v2023.01.15~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=471e77707b83c5842897812059545d619ddc5f8c;p=xfstests-dev.git fuzzy: make freezing optional for scrub stress tests Make the freeze/thaw loop optional, since that's a significant change in behavior if it's enabled. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/common/fuzzy b/common/fuzzy index 0f6fc91b..219dd3bb 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -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" \ diff --git a/tests/xfs/422 b/tests/xfs/422 index faea5d67..ac887132 100755 --- a/tests/xfs/422 +++ b/tests/xfs/422 @@ -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