4 # Test case to reproduce xfs_freeze hang under filsystem load.
5 # The fail case for this test is a hang on an xfs_freeze.
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
9 #-----------------------------------------------------------------------
15 echo "QA output created by $seq"
19 status=0 # success is the default!
32 trap "_cleanup" 0 1 2 3 15
35 # get standard environment, filters and checks
39 # real QA test starts here
41 _supported_os Linux IRIX
48 umount $SCRATCH_DEV >/dev/null 2>&1
49 echo "*** MKFS ***" >>$seq.full
51 _scratch_mkfs_xfs >>$seq.full 2>&1 \
52 || _fail "mkfs failed"
53 _scratch_mount >>$seq.full 2>&1 \
54 || _fail "mount failed"
59 # start fsstress loop in a background block
61 STRESS_DIR="$SCRATCH_MNT/fsstress_test_dir"
66 while [ -f "$tmp.running" ]
68 # -w ensures that the only ops are ones which cause write I/O
69 $FSSTRESS_PROG -d $STRESS_DIR -w -p $procs -n $nops $FSSTRESS_AVOID \
78 ITERATIONS=`expr $ITERATIONS - 1`
80 echo | tee -a $seq.full
81 while [ $i -le $ITERATIONS ]
83 echo "*** iteration: $i" | tee -a $seq.full
84 echo "*** freezing \$SCRATCH_MNT" | tee -a $seq.full
85 xfs_freeze -f "$SCRATCH_MNT" | tee -a $seq.full
86 [ $? != 0 ] && echo xfs_freeze -f "$SCRATCH_MNT" failed | \
90 echo "*** thawing \$SCRATCH_MNT" | tee -a $seq.full
91 xfs_freeze -u "$SCRATCH_MNT" | tee -a $seq.full
92 [ $? != 0 ] && echo xfs_freeze -u "$SCRATCH_MNT" failed | \
96 echo | tee -a $seq.full
100 # stop fsstress iterations
103 # wait for fsstresses to finish