4 # XFS online growfs-while-allocating tests (data subvol variant)
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21 # get standard environment, filters and checks
28 _scratch_mkfs_xfs $@ | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs
32 if ! _scratch_mount 2>/dev/null
34 echo "failed to mount $SCRATCH_DEV"
41 $XFS_IO_PROG -f -c "resvsp 0 ${1}" $SCRATCH_MNT/resvfile
48 # -w ensures that the only ops are ones which cause write I/O
49 $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID &
52 # real QA test starts here
55 _scratch_mkfs_xfs | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs
56 . $tmp.mkfs # extract blocksize and data size for scratch device
58 endsize=`expr 550 \* 1048576` # stop after growing this big
59 incsize=`expr 42 \* 1048576` # grow in chunks of this size
60 modsize=`expr 4 \* $incsize` # pause after this many increments
62 [ `expr $endsize / $dbsize` -lt $dblocks ] || _notrun "Scratch device too small"
65 size=`expr 120 \* 1048576` # 120 megabytes initially
66 sizeb=`expr $size / $dbsize` # in data blocks
67 echo "*** creating scratch filesystem"
68 _create_scratch -dsize=${size} -dagcount=${nags}
70 fillsize=`expr 110 \* 1048576` # 110 megabytes of filling
71 echo "*** using some initial space on scratch filesystem"
72 _fill_scratch $fillsize
75 # Grow the filesystem while actively stressing it...
76 # Kick off more stress threads on each iteration, grow; repeat.
78 while [ $size -le $endsize ]; do
79 echo "*** stressing a ${size} byte filesystem"
80 echo "*** stressing a ${sizeb} block filesystem" >> $seq.full
83 size=`expr $size + $incsize`
84 sizeb=`expr $size / $dbsize` # in data blocks
85 echo "*** growing to a ${size} byte filesystem"
86 echo "*** growing to a ${sizeb} block filesystem" >> $seq.full
87 xfs_growfs -D ${sizeb} $SCRATCH_MNT \
88 | tee -a $seq.full | _filter_mkfs 2>$tmp.growfs
90 [ `expr $size % $modsize` -eq 0 ] && wait # every 4th iteration
91 echo AGCOUNT=$agcount | tee -a $seq.full
92 echo && echo >> $seq.full
94 wait # stop for any remaining stress processes