2010-01-20 10:27:08 +11:00
|
|
|
#! /bin/bash
|
2009-05-28 17:04:15 +02:00
|
|
|
# FS QA Test No. 083
|
|
|
|
|
#
|
|
|
|
|
# Exercise filesystem full behaviour - run numerous fsstress
|
|
|
|
|
# processes in write mode on a small filesystem. NB: delayed
|
|
|
|
|
# allocate flushing is quite deadlock prone at the filesystem
|
|
|
|
|
# full boundary due to the fact that we will retry allocation
|
|
|
|
|
# several times after flushing, before giving back ENOSPC.
|
|
|
|
|
#
|
|
|
|
|
# Note that this test will intentionally cause console msgs of form:
|
|
|
|
|
# dksc0d1s4: Process [fsstress] ran out of disk space
|
|
|
|
|
# dksc0d1s4: Process [fsstress] ran out of disk space
|
|
|
|
|
# dksc0d1s4: Process [fsstress] ran out of disk space
|
2009-05-12 13:24:15 -05:00
|
|
|
#
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it would be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write the Free Software Foundation,
|
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
#
|
|
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
#
|
2004-08-10 03:55:47 +00:00
|
|
|
|
2003-11-07 03:21:51 +00:00
|
|
|
seq=`basename $0`
|
2013-03-15 12:28:02 +00:00
|
|
|
seqres=$RESULT_DIR/$seq
|
2003-11-07 03:21:51 +00:00
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
|
tmp=/tmp/$$
|
|
|
|
|
status=1
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
|
|
|
|
echo "*** unmount"
|
2015-12-21 18:07:43 +11:00
|
|
|
_scratch_unmount 2>/dev/null
|
2004-06-15 07:32:36 +00:00
|
|
|
rm -f $tmp.*
|
2003-11-07 03:21:51 +00:00
|
|
|
}
|
2004-06-15 07:32:36 +00:00
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
2003-11-07 03:21:51 +00:00
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
2013-03-15 12:28:04 +00:00
|
|
|
. ./common/rc
|
|
|
|
|
. ./common/filter
|
2003-11-07 03:21:51 +00:00
|
|
|
|
|
|
|
|
# real QA test starts here
|
2011-08-01 12:31:19 +02:00
|
|
|
_supported_fs generic
|
2017-07-20 21:22:05 -07:00
|
|
|
_supported_os Linux
|
2004-06-15 07:32:36 +00:00
|
|
|
|
2003-11-07 03:21:51 +00:00
|
|
|
_require_scratch
|
2013-03-15 11:53:21 +00:00
|
|
|
_require_no_large_scratch_dev
|
2003-11-07 03:21:51 +00:00
|
|
|
|
2013-03-15 12:28:02 +00:00
|
|
|
rm -f $seqres.full
|
2003-11-10 01:29:28 +00:00
|
|
|
|
|
|
|
|
workout()
|
|
|
|
|
{
|
|
|
|
|
fsz=$1
|
|
|
|
|
ags=$2
|
|
|
|
|
procs=$3
|
2004-08-10 03:55:47 +00:00
|
|
|
nops=$4
|
2003-11-10 01:29:28 +00:00
|
|
|
|
2015-12-21 18:07:43 +11:00
|
|
|
_scratch_unmount >/dev/null 2>&1
|
2013-03-15 12:28:02 +00:00
|
|
|
echo "*** mkfs -dsize=$fsz,agcount=$ags" >>$seqres.full
|
|
|
|
|
echo "" >>$seqres.full
|
2011-08-01 12:31:19 +02:00
|
|
|
if [ $FSTYP = xfs ]
|
|
|
|
|
then
|
2013-03-15 12:28:02 +00:00
|
|
|
_scratch_mkfs_xfs -dsize=$fsz,agcount=$ags >>$seqres.full 2>&1 \
|
2011-08-01 12:31:19 +02:00
|
|
|
|| _fail "size=$fsz,agcount=$ags mkfs failed"
|
|
|
|
|
else
|
2013-03-15 12:28:02 +00:00
|
|
|
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
|
2011-08-01 12:31:19 +02:00
|
|
|
|| _fail "size=$fsz mkfs failed"
|
|
|
|
|
fi
|
2013-03-15 12:28:02 +00:00
|
|
|
_scratch_mount >>$seqres.full 2>&1 \
|
2003-11-10 01:29:28 +00:00
|
|
|
|| _fail "mount failed"
|
|
|
|
|
|
2004-08-10 03:55:47 +00:00
|
|
|
# -w ensures that the only ops are ones which cause write I/O
|
2013-02-20 10:42:10 +00:00
|
|
|
FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID`
|
2013-03-15 12:28:02 +00:00
|
|
|
$FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full
|
2003-11-10 01:29:28 +00:00
|
|
|
}
|
2003-11-07 03:21:51 +00:00
|
|
|
|
|
|
|
|
echo "*** test out-of-space handling for random write operations"
|
|
|
|
|
|
2011-11-04 10:38:03 +08:00
|
|
|
filesize=`expr 100 \* 1024 \* 1024`
|
2004-08-10 03:55:47 +00:00
|
|
|
agcount=6
|
|
|
|
|
numprocs=15
|
2004-11-11 13:38:36 +00:00
|
|
|
numops=1500
|
2004-08-10 03:55:47 +00:00
|
|
|
|
|
|
|
|
workout $filesize $agcount $numprocs $numops
|
2003-11-07 03:21:51 +00:00
|
|
|
|
|
|
|
|
echo "*** done"
|
|
|
|
|
status=0
|
|
|
|
|
exit
|