2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
7 # ENOSPC deadlock case from Asano Masahiro.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
18 # get standard environment, filters and checks
22 # real QA test starts here
28 # "faststart" lets us effectively skip (re-)population
29 [ "X$faststart" != "X" ] && rm -f $SCRATCH_MNT/F*
31 # create many small files using most available space
32 echo "creating small files..."
34 while [ $i -le $files -a "X$faststart" = "X" ]; do
36 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 64k' $file >/dev/null
40 # remove every second file, freeing up lots of space
41 echo "removing small files..."
43 while [ $i -le $files -a "X$faststart" = "X" ]; do
48 echo "flushing changes via umount/mount."
55 # now try to hit the deadlock
56 echo "starting parallel allocators..."
58 while [ $i -le 10 ]; do
62 while [ $j -lt 100 ]; do
63 $XFS_IO_PROG -f -c 'pwrite -b 64k 0 16m' $file \
65 test -e $file && rm $file
76 # real QA test starts here
77 _scratch_mkfs_xfs >> $seqres.full
81 # see if faststart is possible (and requested)
84 if [ -n "$FASTSTART" -a -f $SCRATCH_MNT/f0 ]; then
85 faststart="-N" # causes us to skip the mkfs step
89 _scratch_mkfs_xfs -dsize=160m,agcount=4 $faststart | _filter_mkfs 2>$tmp.mkfs
90 cat $tmp.mkfs >>$seqres.full