xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / generic / 224
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Dave Chinner.  All Rights Reserved.
4 #
5 # FS QA Test No. 224
6 #
7 # Delayed allocation at ENOSPC test
8 #
9 # Derived from a test case from Lachlan McIlroy and improved to
10 # reliably trigger a BUG in xfs_get_blocks(). Despite this XFS
11 # focus, the test can to run on any filesystem to exercise ENOSPC
12 # behaviour.
13 #
14 seq=`basename $0`
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
17
18 here=`pwd`
19 tmp=/tmp/$$
20 status=1        # failure is the default!
21
22 _cleanup()
23 {
24         rm -f $tmp.*
25         rm -f $SCRATCH_MNT/testfile.*
26 }
27
28 trap "_cleanup ; exit \$status" 0 1 2 3 15
29
30 # get standard environment, filters and checks
31 . ./common/rc
32 . ./common/filter
33
34 # real QA test starts here
35 _supported_fs generic
36 _supported_os Linux
37
38 _require_scratch
39
40 # make a 1GB filesystem
41 _scratch_mkfs_sized `expr 1024 \* 1024 \* 1024` > $seqres.full 2>&1
42 _scratch_mount >> $seqres.full 2>&1
43
44 # set the reserved block pool to almost empty for XFS
45 if [ "$FSTYP" = "xfs" ]; then
46         $XFS_IO_PROG -x -c "resblks 4" $SCRATCH_MNT >> $seqres.full 2>&1
47 fi
48
49 FILES=1000
50 for i in `seq 0 1 $FILES`; do
51
52         # set the file size to be 10MB - that way the direct IO will always try
53         # to read at least 10MB even if only 4k was written. This allows
54         # discarded delalloc pages that would have been beyond EOF to be
55         # tripped over.
56         (
57                 sleep 5
58                 $XFS_IO_PROG -f -c "truncate 10485760" $SCRATCH_MNT/testfile.$i
59                 dd if=/dev/zero of=$SCRATCH_MNT/testfile.$i bs=4k conv=notrunc
60         ) > /dev/null 2>&1 &
61 done
62 wait
63
64 for i in `seq 0 1 $FILES`; do
65         dd of=/dev/null if=$SCRATCH_MNT/testfile.$i bs=512k iflag=direct > /dev/null 2>&1 &
66 done
67 wait
68 echo "*** Silence is golden ***"
69
70 # unmount and check dmesg, filtering out expected warnings about mixed
71 # direct and buffered I/O
72 _scratch_unmount
73 _check_dmesg _filter_aiodio_dmesg
74
75 status=$?
76 exit