generic/095: don't silence fio error output
[xfstests-dev.git] / tests / generic / 095
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
4 #
5 # FS QA Test generic/095
6 #
7 # Concurrent mixed I/O (buffer I/O, aiodio, mmap, splice) on the same files
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20         cd /
21         rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # real QA test starts here
29 _supported_fs generic
30 _require_scratch
31 _require_odirect
32
33 iodepth=$((16 * LOAD_FACTOR))
34 iodepth_batch=$((8 * LOAD_FACTOR))
35 numjobs=$((5 * LOAD_FACTOR))
36 fio_config=$tmp.fio
37 cat >$fio_config <<EOF
38 [global]
39 bs=8k
40 iodepth=$iodepth
41 iodepth_batch=$iodepth_batch
42 randrepeat=1
43 size=1m
44 directory=$SCRATCH_MNT
45 numjobs=$numjobs
46 [job1]
47 ioengine=sync
48 bs=1k
49 direct=1
50 rw=randread
51 filename=file1:file2
52 [job2]
53 ioengine=libaio
54 rw=randwrite
55 direct=1
56 filename=file1:file2
57 [job3]
58 bs=1k
59 ioengine=posixaio
60 rw=randwrite
61 direct=1
62 filename=file1:file2
63 [job4]
64 ioengine=splice
65 direct=1
66 rw=randwrite
67 filename=file1:file2
68 [job5]
69 bs=1k
70 ioengine=sync
71 rw=randread
72 filename=file1:file2
73 [job6]
74 ioengine=posixaio
75 rw=randwrite
76 filename=file1:file2
77 [job7]
78 ioengine=splice
79 rw=randwrite
80 filename=file1:file2
81 [job8]
82 ioengine=mmap
83 rw=randwrite
84 bs=1k
85 filename=file1:file2
86 [job9]
87 ioengine=mmap
88 rw=randwrite
89 direct=1
90 filename=file1:file2
91 EOF
92 # with ioengine=mmap and direct=1, fio requires bs to be at least pagesize,
93 # which is a fio built-in var.
94 echo 'bs=$pagesize' >> $fio_config
95
96 rm -f $seqres.full
97 _require_fio $fio_config
98 _scratch_mkfs >>$seqres.full 2>&1
99 _scratch_mount
100
101 # There's a known EIO failure to report collisions between directio and buffered
102 # writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error
103 # at here.
104 $FIO_PROG $fio_config --ignore_error=,EIO --output=$seqres.full
105 echo "Silence is golden"
106
107 # xfs generates WARNINGs on purpose when applications mix buffered/mmap IO with
108 # direct IO on the same file. On the other hand, this fio job has been proven
109 # to be potent, we don't want to simply _disable_dmesg_check which could miss
110 # other potential bugs. So filter out the intentional WARNINGs, make sure test
111 # doesn't fail because of this warning and fails on other WARNINGs.
112
113 # umount before checking dmesg in case umount triggers any WARNING or Oops
114 _scratch_unmount
115
116 _check_dmesg _filter_aiodio_dmesg
117
118 status=$?
119 exit