2002-09-02 06:04:01 +00:00
|
|
|
#! /bin/sh
|
2005-02-09 02:49:23 +00:00
|
|
|
# FSQA Test No. 068
|
2002-09-02 06:04:01 +00:00
|
|
|
#
|
2005-02-09 02:49:23 +00:00
|
|
|
# Test case to reproduce xfs_freeze hang under filsystem load.
|
|
|
|
|
# The fail case for this test is a hang on an xfs_freeze.
|
2002-09-02 06:04:01 +00:00
|
|
|
#
|
|
|
|
|
#-----------------------------------------------------------------------
|
2005-02-09 02:49:23 +00:00
|
|
|
# Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
|
2002-09-02 06:04:01 +00:00
|
|
|
#-----------------------------------------------------------------------
|
|
|
|
|
#
|
|
|
|
|
# creator
|
2005-02-09 02:49:23 +00:00
|
|
|
owner=ajones@sgi.com
|
2002-09-02 06:04:01 +00:00
|
|
|
|
|
|
|
|
seq=`basename $0`
|
|
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
2002-09-03 06:34:06 +00:00
|
|
|
tmp=/tmp/$$
|
2005-02-09 02:49:23 +00:00
|
|
|
status=0 # success is the default!
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
ITERATIONS=10
|
2002-09-02 06:04:01 +00:00
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
2005-02-09 02:49:23 +00:00
|
|
|
cd /
|
|
|
|
|
_cleanup_testdir
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
trap 0 1 2 3 15
|
|
|
|
|
exit $status
|
2002-09-02 06:04:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
trap "_cleanup" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
|
|
|
|
. ./common.rc
|
|
|
|
|
. ./common.filter
|
|
|
|
|
|
2004-06-15 07:32:36 +00:00
|
|
|
# real QA test starts here
|
|
|
|
|
_supported_fs xfs
|
2005-02-09 02:49:23 +00:00
|
|
|
_supported_os Linux IRIX
|
2004-06-15 07:32:36 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
_require_scratch
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
echo "*** init FS"
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
rm -f $seq.full
|
|
|
|
|
umount $SCRATCH_DEV >/dev/null 2>&1
|
|
|
|
|
echo "*** MKFS ***" >>$seq.full
|
|
|
|
|
echo "" >>$seq.full
|
|
|
|
|
_scratch_mkfs_xfs >>$seq.full 2>&1 \
|
|
|
|
|
|| _fail "mkfs failed"
|
|
|
|
|
_scratch_mount >>$seq.full 2>&1 \
|
|
|
|
|
|| _fail "mount failed"
|
|
|
|
|
|
|
|
|
|
touch $tmp.running
|
2002-09-02 06:04:01 +00:00
|
|
|
|
|
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
# start fsstress loop in a background block
|
|
|
|
|
{
|
|
|
|
|
STRESS_DIR="$SCRATCH_MNT/fsstress_test_dir"
|
|
|
|
|
mkdir "$STRESS_DIR"
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
procs=2
|
|
|
|
|
nops=200
|
|
|
|
|
while [ -f "$tmp.running" ]
|
|
|
|
|
do
|
|
|
|
|
# -w ensures that the only ops are ones which cause write I/O
|
2005-12-09 02:52:22 +00:00
|
|
|
$FSSTRESS_PROG -d $STRESS_DIR -w -p $procs -n $nops $FSSTRESS_AVOID \
|
2005-02-09 02:49:23 +00:00
|
|
|
> /dev/null 2>&1
|
|
|
|
|
done
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
rm -r $STRESS_DIR/*
|
|
|
|
|
rmdir $STRESS_DIR
|
|
|
|
|
} &
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
i=0
|
|
|
|
|
ITERATIONS=`expr $ITERATIONS - 1`
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
echo | tee -a $seq.full
|
|
|
|
|
while [ $i -le $ITERATIONS ]
|
2002-09-02 06:04:01 +00:00
|
|
|
do
|
2005-02-09 02:49:23 +00:00
|
|
|
echo "*** iteration: $i" | tee -a $seq.full
|
|
|
|
|
echo "*** freezing \$SCRATCH_MNT" | tee -a $seq.full
|
|
|
|
|
xfs_freeze -f "$SCRATCH_MNT" | tee -a $seq.full
|
|
|
|
|
[ $? != 0 ] && echo xfs_freeze -f "$SCRATCH_MNT" failed | \
|
|
|
|
|
tee -a $seq.full
|
|
|
|
|
sleep 2
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
echo "*** thawing \$SCRATCH_MNT" | tee -a $seq.full
|
|
|
|
|
xfs_freeze -u "$SCRATCH_MNT" | tee -a $seq.full
|
|
|
|
|
[ $? != 0 ] && echo xfs_freeze -u "$SCRATCH_MNT" failed | \
|
|
|
|
|
tee -a $seq.full
|
|
|
|
|
sleep 2
|
2002-09-02 06:04:01 +00:00
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
echo | tee -a $seq.full
|
|
|
|
|
i=`expr $i + 1`
|
2002-09-02 06:04:01 +00:00
|
|
|
done
|
|
|
|
|
|
2005-02-09 02:49:23 +00:00
|
|
|
# stop fsstress iterations
|
|
|
|
|
rm $tmp.running
|
|
|
|
|
|
|
|
|
|
# wait for fsstresses to finish
|
|
|
|
|
wait
|
|
|
|
|
|
|
|
|
|
_check_scratch_fs
|
|
|
|
|
|
|
|
|
|
exit 1
|