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
24 _supported_os Linux XFS
29 # "faststart" lets us effectively skip (re-)population
30 [ "X$faststart" != "X" ] && rm -f $SCRATCH_MNT/F*
32 # create many small files using most available space
33 echo "creating small files..."
35 while [ $i -le $files -a "X$faststart" = "X" ]; do
37 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 64k' $file >/dev/null
41 # remove every second file, freeing up lots of space
42 echo "removing small files..."
44 while [ $i -le $files -a "X$faststart" = "X" ]; do
49 echo "flushing changes via umount/mount."
56 # now try to hit the deadlock
57 echo "starting parallel allocators..."
59 while [ $i -le 10 ]; do
63 while [ $j -lt 100 ]; do
64 $XFS_IO_PROG -f -c 'pwrite -b 64k 0 16m' $file \
66 test -e $file && rm $file
77 # real QA test starts here
78 _scratch_unmount 2>/dev/null
82 # see if faststart is possible (and requested)
85 if [ -n "$FASTSTART" -a -f $SCRATCH_MNT/f0 ]; then
86 faststart="-N" # causes us to skip the mkfs step
90 _scratch_mkfs_xfs -dsize=160m,agcount=4 $faststart | _filter_mkfs 2>$tmp.mkfs
91 cat $tmp.mkfs >>$seqres.full