xfstests: randholes: clean up readblks()
[xfstests-dev.git] / 083
1 #! /bin/bash
2 # FS QA Test No. 083
3 #
4 # Exercise filesystem full behaviour - run numerous fsstress
5 # processes in write mode on a small filesystem.  NB: delayed
6 # allocate flushing is quite deadlock prone at the filesystem
7 # full boundary due to the fact that we will retry allocation
8 # several times after flushing, before giving back ENOSPC.
9 #
10 # Note that this test will intentionally cause console msgs of form:
11 #     dksc0d1s4: Process [fsstress] ran out of disk space
12 #     dksc0d1s4: Process [fsstress] ran out of disk space
13 #     dksc0d1s4: Process [fsstress] ran out of disk space
14 #
15 #-----------------------------------------------------------------------
16 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
17 #
18 # This program is free software; you can redistribute it and/or
19 # modify it under the terms of the GNU General Public License as
20 # published by the Free Software Foundation.
21 #
22 # This program is distributed in the hope that it would be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25 # GNU General Public License for more details.
26 #
27 # You should have received a copy of the GNU General Public License
28 # along with this program; if not, write the Free Software Foundation,
29 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
30 #
31 #-----------------------------------------------------------------------
32 #
33
34 # creator
35 owner=nathans@sgi.com
36
37 seq=`basename $0`
38 echo "QA output created by $seq"
39
40 here=`pwd`
41 tmp=/tmp/$$
42 status=1
43
44 _cleanup()
45 {
46         echo "*** unmount"
47         umount $SCRATCH_MNT 2>/dev/null
48         rm -f $tmp.*
49 }
50 trap "_cleanup; exit \$status" 0 1 2 3 15
51
52 # get standard environment, filters and checks
53 . ./common.rc
54 . ./common.filter
55
56 # real QA test starts here
57 _supported_fs xfs
58 _supported_os IRIX Linux
59
60 _require_scratch
61 _require_nobigloopfs
62
63 rm -f $seq.full
64
65 workout()
66 {
67         fsz=$1
68         ags=$2
69         procs=$3
70         nops=$4
71
72         umount $SCRATCH_DEV >/dev/null 2>&1
73         echo "*** mkfs -dsize=$fsz,agcount=$ags"    >>$seq.full
74         echo ""                                     >>$seq.full
75         _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags  >>$seq.full 2>&1 \
76                 || _fail "size=$fsz,agcount=$ags mkfs failed"
77         _scratch_mount                              >>$seq.full 2>&1 \
78                 || _fail "mount failed"
79
80         # -w ensures that the only ops are ones which cause write I/O
81         $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID \
82                 >>$seq.full
83         _check_scratch_fs
84 }
85
86 echo "*** test out-of-space handling for random write operations"
87
88 filesize=100m
89 agcount=6
90 numprocs=15
91 numops=1500
92
93 workout $filesize $agcount $numprocs $numops
94
95 echo "*** done"
96 status=0
97 exit