xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / generic / 427
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 427
6 #
7 # Try to trigger a race of free eofblocks and file extending dio writes.
8 # A known bug of XFS has been fixed by "e4229d6 xfs: fix eofblocks race
9 # with file extending async dio writes"
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 _cleanup()
21 {
22         cd /
23         rm -f $tmp.*
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29
30 # remove previous $seqres.full before test
31 rm -f $seqres.full
32
33 # real QA test starts here
34
35 # Modify as appropriate.
36 _supported_fs generic
37 _supported_os Linux
38 _require_scratch
39 _require_test_program "feature"
40 _require_aiodio aio-dio-eof-race
41
42 # limit the filesystem size, to save the time of filling filesystem
43 _scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1
44 _scratch_mount
45
46 # try to write more bytes than filesystem size to fill the filesystem,
47 # then remove all these data. If we still can find these stale data in
48 # a file' eofblock, then it's a bug
49 $XFS_IO_PROG -f -c "pwrite -S 0x55 0 $((256 * 1024 * 1024 * 2))" \
50              $SCRATCH_MNT/fillfs-$seq 2>/dev/null
51 rm -f $SCRATCH_MNT/fillfs-$seq
52
53 # open & close the file frequently, to trigger xfs_free_eofblocks
54 while true; do
55         $XFS_IO_PROG -f -c open $SCRATCH_MNT/tst-aio-dio-eof-race.$seq \
56                 >/dev/null 2>&1
57 done &
58 open_close_pid=$!
59
60 nr_cpu=`$here/src/feature -o`
61 fsize=$((nr_cpu * 10))
62 if [ $fsize -gt 200 ]; then
63         fsize=200
64 fi
65 # start a background aio writer, which does several extending loops
66 # internally and check data integrality
67 $AIO_TEST -s $fsize -b 65536 $SCRATCH_MNT/tst-aio-dio-eof-race.$seq
68 status=$?
69
70 kill $open_close_pid
71 wait $open_close_pid
72 exit