2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc. All Rights Reserved.
7 # Race fio and xfs_scrub for a while to see if we crash or livelock.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 7 15
24 # get standard environment, filters and checks
30 # real QA test starts here
33 _require_test_program "feature"
34 _require_command "$KILLALL_PROG" killall
35 _require_command "$TIMEOUT_PROG" timeout
38 # xfs_scrub will turn on error injection itself
39 _require_xfs_io_error_injection "force_repair"
41 echo "Format and populate"
42 _scratch_mkfs > "$seqres.full" 2>&1
45 STRESS_DIR="$SCRATCH_MNT/testdir"
48 cpus=$(( $(src/feature -o) * 4 * LOAD_FACTOR))
49 $FSSTRESS_PROG -d $STRESS_DIR -p $cpus -n $((cpus * 100000)) $FSSTRESS_AVOID >/dev/null 2>&1 &
50 $XFS_SCRUB_PROG -d -T -v -n $SCRATCH_MNT >> $seqres.full
53 sleep $(( 60 * TIME_FACTOR ))
54 $KILLALL_PROG -q $FSSTRESS_PROG
57 echo "Concurrent repair"
59 end=$((start + (60 * TIME_FACTOR) ))
61 echo "Repair started at $(date --date="@${start}"), ending at $(date --date="@${end}")" >> $seqres.full
62 while [ "$(date +%s)" -lt "$end" ]; do
63 XFS_SCRUB_FORCE_REPAIR=1 $TIMEOUT_PROG -s TERM $(( end - $(date +%s) + 2 )) $XFS_SCRUB_PROG -d -T -v $SCRATCH_MNT >> $seqres.full
67 echo "Repair finished at $(date)" >> $seqres.full
68 $KILLALL_PROG -q $FSSTRESS_PROG