generic: Verify the inheritance behavior of FS_XFLAG_DAX flag in various combinations
[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 _supported_os Linux
31 _require_scratch
32 _require_odirect
33
34 iodepth=$((16 * LOAD_FACTOR))
35 iodepth_batch=$((8 * LOAD_FACTOR))
36 numjobs=$((5 * LOAD_FACTOR))
37 fio_config=$tmp.fio
38 cat >$fio_config <<EOF
39 [global]
40 bs=8k
41 iodepth=$iodepth
42 iodepth_batch=$iodepth_batch
43 randrepeat=1
44 size=1m
45 directory=$SCRATCH_MNT
46 numjobs=$numjobs
47 [job1]
48 ioengine=sync
49 bs=1k
50 direct=1
51 rw=randread
52 filename=file1:file2
53 [job2]
54 ioengine=libaio
55 rw=randwrite
56 direct=1
57 filename=file1:file2
58 [job3]
59 bs=1k
60 ioengine=posixaio
61 rw=randwrite
62 direct=1
63 filename=file1:file2
64 [job4]
65 ioengine=splice
66 direct=1
67 rw=randwrite
68 filename=file1:file2
69 [job5]
70 bs=1k
71 ioengine=sync
72 rw=randread
73 filename=file1:file2
74 [job6]
75 ioengine=posixaio
76 rw=randwrite
77 filename=file1:file2
78 [job7]
79 ioengine=splice
80 rw=randwrite
81 filename=file1:file2
82 [job8]
83 ioengine=mmap
84 rw=randwrite
85 bs=1k
86 filename=file1:file2
87 [job9]
88 ioengine=mmap
89 rw=randwrite
90 direct=1
91 filename=file1:file2
92 EOF
93 # with ioengine=mmap and direct=1, fio requires bs to be at least pagesize,
94 # which is a fio built-in var.
95 echo 'bs=$pagesize' >> $fio_config
96
97 rm -f $seqres.full
98 _require_fio $fio_config
99 _scratch_mkfs >>$seqres.full 2>&1
100 _scratch_mount
101
102 echo "Silence is golden"
103 $FIO_PROG $fio_config >>$seqres.full 2>&1
104
105 # xfs generates WARNINGs on purpose when applications mix buffered/mmap IO with
106 # direct IO on the same file. On the other hand, this fio job has been proven
107 # to be potent, we don't want to simply _disable_dmesg_check which could miss
108 # other potential bugs. So filter out the intentional WARNINGs, make sure test
109 # doesn't fail because of this warning and fails on other WARNINGs.
110
111 # umount before checking dmesg in case umount triggers any WARNING or Oops
112 _scratch_unmount
113
114 _check_dmesg _filter_aiodio_dmesg
115
116 status=$?
117 exit