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 _begin_fstest metadata auto
12 # Import common functions.
15 # real QA test starts here
21 # "faststart" lets us effectively skip (re-)population
22 [ "X$faststart" != "X" ] && rm -f $SCRATCH_MNT/F*
24 # create many small files using most available space
25 echo "creating small files..."
27 while [ $i -le $files -a "X$faststart" = "X" ]; do
29 $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 64k' $file >/dev/null
33 # remove every second file, freeing up lots of space
34 echo "removing small files..."
36 while [ $i -le $files -a "X$faststart" = "X" ]; do
41 echo "flushing changes via umount/mount."
48 # now try to hit the deadlock
49 echo "starting parallel allocators..."
51 while [ $i -le 10 ]; do
55 while [ $j -lt 100 ]; do
56 $XFS_IO_PROG -f -c 'pwrite -b 64k 0 16m' $file \
58 test -e $file && rm $file
69 # real QA test starts here
70 _scratch_mkfs_xfs >> $seqres.full
73 # see if faststart is possible (and requested)
76 if [ -n "$FASTSTART" -a -f $SCRATCH_MNT/f0 ]; then
77 faststart="-N" # causes us to skip the mkfs step
81 _scratch_mkfs_xfs -dsize=160m,agcount=4 $faststart | _filter_mkfs 2>$tmp.mkfs
82 cat $tmp.mkfs >>$seqres.full