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
43 _scratch_unmount >/dev/null 2>&1
44 echo "*** MKFS ***" >>$seqres.full
45 echo "" >>$seqres.full
46 _scratch_mkfs >>$seqres.full 2>&1 \
47 || _fail "mkfs failed"
52 # start fsstress loop in a background block
54 STRESS_DIR="$SCRATCH_MNT/fsstress_test_dir"
59 while [ -f "$tmp.running" ]
61 # We do both read & write IO - not only is this more realistic,
62 # but it also potentially tests atime updates
63 FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops $FSSTRESS_AVOID`
64 $FSSTRESS_PROG $FSSTRESS_ARGS > /dev/null 2>&1
71 # start fstest -m loop in a background block; this gets us mmap coverage
73 FSTEST_DIR="$SCRATCH_MNT/fstest_test_dir"
77 while [ -f "$tmp.running" ]
79 $here/src/fstest -m -p $FSTEST_DIR -n $procs -f 4 > /dev/null 2>&1
87 let ITERATIONS=$ITERATIONS-1
89 echo | tee -a $seqres.full
90 while [ $i -le $ITERATIONS ]
92 echo "*** iteration: $i" | tee -a $seqres.full
93 echo "*** freezing \$SCRATCH_MNT" | tee -a $seqres.full
94 xfs_freeze -f "$SCRATCH_MNT" | tee -a $seqres.full
95 [ $? != 0 ] && echo xfs_freeze -f "$SCRATCH_MNT" failed | \
99 echo "*** thawing \$SCRATCH_MNT" | tee -a $seqres.full
100 xfs_freeze -u "$SCRATCH_MNT" | tee -a $seqres.full
101 [ $? != 0 ] && echo xfs_freeze -u "$SCRATCH_MNT" failed | \
105 echo | tee -a $seqres.full
109 # stop fsstress iterations
112 # wait for fsstresses to finish