4 # XFS online growfs-while-allocating tests (data subvol variant)
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35 # get standard environment, filters and checks
42 _scratch_mkfs_xfs $@ | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs
46 if ! _scratch_mount 2>/dev/null
48 echo "failed to mount $SCRATCH_DEV"
55 $XFS_IO_PROG -f -c "resvsp 0 ${1}" $SCRATCH_MNT/resvfile
62 # -w ensures that the only ops are ones which cause write I/O
63 $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID > /dev/null &
66 # real QA test starts here
69 _scratch_mkfs_xfs | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs
70 . $tmp.mkfs # extract blocksize and data size for scratch device
72 endsize=`expr 550 \* 1048576` # stop after growing this big
73 incsize=`expr 42 \* 1048576` # grow in chunks of this size
74 modsize=`expr 4 \* $incsize` # pause after this many increments
76 [ `expr $endsize / $dbsize` -lt $dblocks ] || _notrun "Scratch device too small"
79 size=`expr 120 \* 1048576` # 120 megabytes initially
80 sizeb=`expr $size / $dbsize` # in data blocks
81 echo "*** creating scratch filesystem"
82 _create_scratch -dsize=${size} -dagcount=${nags}
84 fillsize=`expr 110 \* 1048576` # 110 megabytes of filling
85 echo "*** using some initial space on scratch filesystem"
86 _fill_scratch $fillsize
89 # Grow the filesystem while actively stressing it...
90 # Kick off more stress threads on each iteration, grow; repeat.
92 while [ $size -le $endsize ]; do
93 echo "*** stressing a ${size} byte filesystem"
94 echo "*** stressing a ${sizeb} block filesystem" >> $seq.full
97 size=`expr $size + $incsize`
98 sizeb=`expr $size / $dbsize` # in data blocks
99 echo "*** growing to a ${size} byte filesystem"
100 echo "*** growing to a ${sizeb} block filesystem" >> $seq.full
101 xfs_growfs -D ${sizeb} $SCRATCH_MNT \
102 | tee -a $seq.full | _filter_mkfs 2>$tmp.growfs
104 [ `expr $size % $modsize` -eq 0 ] && wait # every 4th iteration
105 echo AGCOUNT=$agcount | tee -a $seq.full
106 echo && echo >> $seq.full
108 wait # stop for any remaining stress processes