generic/520: Remove sync in clean_dir
[xfstests-dev.git] / tests / generic / 083
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 083
6 #
7 # Exercise filesystem full behaviour - run numerous fsstress
8 # processes in write mode on a small filesystem.  NB: delayed
9 # allocate flushing is quite deadlock prone at the filesystem
10 # full boundary due to the fact that we will retry allocation
11 # several times after flushing, before giving back ENOSPC.
12 #
13 # Note that this test will intentionally cause console msgs of form:
14 #     dksc0d1s4: Process [fsstress] ran out of disk space
15 #     dksc0d1s4: Process [fsstress] ran out of disk space
16 #     dksc0d1s4: Process [fsstress] ran out of disk space
17 #
18 seq=`basename $0`
19 seqres=$RESULT_DIR/$seq
20 echo "QA output created by $seq"
21
22 here=`pwd`
23 tmp=/tmp/$$
24 status=1
25
26 _cleanup()
27 {
28         echo "*** unmount"
29         _scratch_unmount 2>/dev/null
30         rm -f $tmp.*
31 }
32 trap "_cleanup; exit \$status" 0 1 2 3 15
33
34 # get standard environment, filters and checks
35 . ./common/rc
36 . ./common/filter
37
38 # real QA test starts here
39 _supported_fs generic
40 _supported_os Linux
41
42 _require_scratch
43 _require_no_large_scratch_dev
44
45 rm -f $seqres.full
46
47 workout()
48 {
49         fsz=$1
50         ags=$2
51         procs=$3
52         nops=$4
53
54         _scratch_unmount >/dev/null 2>&1
55         echo "*** mkfs -dsize=$fsz,agcount=$ags"    >>$seqres.full
56         echo ""                                     >>$seqres.full
57         if [ $FSTYP = xfs ]
58         then
59                 _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags  >>$seqres.full 2>&1 \
60                         || _fail "size=$fsz,agcount=$ags mkfs failed"
61         else
62                 _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
63                         || _fail "size=$fsz mkfs failed"
64         fi
65         _scratch_mount
66
67         # -w ensures that the only ops are ones which cause write I/O
68         FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID`
69         $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full
70 }
71
72 echo "*** test out-of-space handling for random write operations"
73
74 filesize=`expr 256 \* 1024 \* 1024`
75 agcount=6
76 numprocs=15
77 numops=1500
78
79 workout $filesize $agcount $numprocs $numops
80
81 echo "*** done"
82 status=0
83 exit