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 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 # Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
25 # Mountain View, CA 94043, USA, or: http://www.sgi.com
26 #-----------------------------------------------------------------------
32 echo "QA output created by $seq"
36 status=0 # success is the default!
49 trap "_cleanup" 0 1 2 3 15
52 # get standard environment, filters and checks
56 # real QA test starts here
58 _supported_os Linux IRIX
65 umount $SCRATCH_DEV >/dev/null 2>&1
66 echo "*** MKFS ***" >>$seq.full
68 _scratch_mkfs_xfs >>$seq.full 2>&1 \
69 || _fail "mkfs failed"
70 _scratch_mount >>$seq.full 2>&1 \
71 || _fail "mount failed"
76 # start fsstress loop in a background block
78 STRESS_DIR="$SCRATCH_MNT/fsstress_test_dir"
83 while [ -f "$tmp.running" ]
85 # -w ensures that the only ops are ones which cause write I/O
86 ltp/fsstress -d $STRESS_DIR -w -p $procs -n $nops $FSSTRESS_AVOID \
95 ITERATIONS=`expr $ITERATIONS - 1`
97 echo | tee -a $seq.full
98 while [ $i -le $ITERATIONS ]
100 echo "*** iteration: $i" | tee -a $seq.full
101 echo "*** freezing \$SCRATCH_MNT" | tee -a $seq.full
102 xfs_freeze -f "$SCRATCH_MNT" | tee -a $seq.full
103 [ $? != 0 ] && echo xfs_freeze -f "$SCRATCH_MNT" failed | \
107 echo "*** thawing \$SCRATCH_MNT" | tee -a $seq.full
108 xfs_freeze -u "$SCRATCH_MNT" | tee -a $seq.full
109 [ $? != 0 ] && echo xfs_freeze -u "$SCRATCH_MNT" failed | \
113 echo | tee -a $seq.full
117 # stop fsstress iterations
120 # wait for fsstresses to finish