2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
7 # Test case to reproduce xfs_freeze hang under filsystem load.
8 # The fail case for this test is a hang on an xfs_freeze.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=0 # success is the default!
28 trap "_cleanup" 0 1 2 3 15
30 # get standard environment, filters and checks
34 # real QA test starts here
44 _scratch_unmount >/dev/null 2>&1
45 echo "*** MKFS ***" >>$seqres.full
46 echo "" >>$seqres.full
47 _scratch_mkfs >>$seqres.full 2>&1 \
48 || _fail "mkfs failed"
53 # start fsstress loop in a background block
55 STRESS_DIR="$SCRATCH_MNT/fsstress_test_dir"
60 while [ -f "$tmp.running" ]
62 # We do both read & write IO - not only is this more realistic,
63 # but it also potentially tests atime updates
64 FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops $FSSTRESS_AVOID`
65 $FSSTRESS_PROG $FSSTRESS_ARGS > /dev/null 2>&1
72 # start fstest -m loop in a background block; this gets us mmap coverage
74 FSTEST_DIR="$SCRATCH_MNT/fstest_test_dir"
78 while [ -f "$tmp.running" ]
80 src/fstest -m -p $FSTEST_DIR -n $procs -f 4 > /dev/null 2>&1
88 let ITERATIONS=$ITERATIONS-1
90 echo | tee -a $seqres.full
91 while [ $i -le $ITERATIONS ]
93 echo "*** iteration: $i" | tee -a $seqres.full
94 echo "*** freezing \$SCRATCH_MNT" | tee -a $seqres.full
95 xfs_freeze -f "$SCRATCH_MNT" | tee -a $seqres.full
96 [ $? != 0 ] && echo xfs_freeze -f "$SCRATCH_MNT" failed | \
100 echo "*** thawing \$SCRATCH_MNT" | tee -a $seqres.full
101 xfs_freeze -u "$SCRATCH_MNT" | tee -a $seqres.full
102 [ $? != 0 ] && echo xfs_freeze -u "$SCRATCH_MNT" failed | \
106 echo | tee -a $seqres.full
110 # stop fsstress iterations
113 # wait for fsstresses to finish