mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
eeea532122
In commit d55123c080 ("generic/247: filter out expected XFS warnings
for mixed mmap/direct I/O"), _scratch_unmount was removed from
generic/095 and added to generic/247. But actually generic/095 *should*
be unmounting SCRATCH_DEV; and generic/247 should be unmounting
TEST_DEV, not SCRATCH_DEV, since it doesn't use a scratch device (it was
failing if SCRATCH_DEV was not defined). Fix it.
[eguan: the original bug was introduced by me not Brian, as I
removed _scratch_unmount from wrong test]
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
136 lines
3.0 KiB
Bash
Executable File
136 lines
3.0 KiB
Bash
Executable File
#! /bin/bash
|
|
# FS QA Test generic/095
|
|
#
|
|
# Concurrent mixed I/O (buffer I/O, aiodio, mmap, splice) on the same files
|
|
#
|
|
#-----------------------------------------------------------------------
|
|
# Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License as
|
|
# published by the Free Software Foundation.
|
|
#
|
|
# This program is distributed in the hope that it would be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write the Free Software Foundation,
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
#-----------------------------------------------------------------------
|
|
#
|
|
|
|
seq=`basename $0`
|
|
seqres=$RESULT_DIR/$seq
|
|
echo "QA output created by $seq"
|
|
|
|
here=`pwd`
|
|
tmp=/tmp/$$
|
|
status=1 # failure is the default!
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
_cleanup()
|
|
{
|
|
cd /
|
|
rm -f $tmp.*
|
|
}
|
|
|
|
# get standard environment, filters and checks
|
|
. ./common/rc
|
|
. ./common/filter
|
|
|
|
# real QA test starts here
|
|
_supported_fs generic
|
|
_supported_os Linux
|
|
_require_scratch
|
|
_require_odirect
|
|
|
|
iodepth=$((16 * LOAD_FACTOR))
|
|
iodepth_batch=$((8 * LOAD_FACTOR))
|
|
numjobs=$((5 * LOAD_FACTOR))
|
|
fio_config=$tmp.fio
|
|
cat >$fio_config <<EOF
|
|
[global]
|
|
bs=8k
|
|
iodepth=$iodepth
|
|
iodepth_batch=$iodepth_batch
|
|
randrepeat=1
|
|
size=1m
|
|
directory=$SCRATCH_MNT
|
|
numjobs=$numjobs
|
|
[job1]
|
|
ioengine=sync
|
|
bs=1k
|
|
direct=1
|
|
rw=randread
|
|
filename=file1:file2
|
|
[job2]
|
|
ioengine=libaio
|
|
rw=randwrite
|
|
direct=1
|
|
filename=file1:file2
|
|
[job3]
|
|
bs=1k
|
|
ioengine=posixaio
|
|
rw=randwrite
|
|
direct=1
|
|
filename=file1:file2
|
|
[job4]
|
|
ioengine=splice
|
|
direct=1
|
|
rw=randwrite
|
|
filename=file1:file2
|
|
[job5]
|
|
bs=1k
|
|
ioengine=sync
|
|
rw=randread
|
|
filename=file1:file2
|
|
[job6]
|
|
ioengine=posixaio
|
|
rw=randwrite
|
|
filename=file1:file2
|
|
[job7]
|
|
ioengine=splice
|
|
rw=randwrite
|
|
filename=file1:file2
|
|
[job8]
|
|
ioengine=mmap
|
|
rw=randwrite
|
|
bs=1k
|
|
filename=file1:file2
|
|
[job9]
|
|
ioengine=mmap
|
|
rw=randwrite
|
|
direct=1
|
|
filename=file1:file2
|
|
EOF
|
|
# with ioengine=mmap and direct=1, fio requires bs to be at least pagesize,
|
|
# which is a fio built-in var.
|
|
echo 'bs=$pagesize' >> $fio_config
|
|
|
|
rm -f $seqres.full
|
|
_require_fio $fio_config
|
|
_scratch_mkfs >>$seqres.full 2>&1
|
|
_scratch_mount
|
|
|
|
echo "Silence is golden"
|
|
$FIO_PROG $fio_config >>$seqres.full 2>&1
|
|
|
|
# xfs generates WARNINGs on purpose when applications mix buffered/mmap IO with
|
|
# direct IO on the same file. On the other hand, this fio job has been proven
|
|
# to be potent, we don't want to simply _disable_dmesg_check which could miss
|
|
# other potential bugs. So filter out the intentional WARNINGs, make sure test
|
|
# doesn't fail because of this warning and fails on other WARNINGs.
|
|
|
|
# umount before checking dmesg in case umount triggers any WARNING or Oops
|
|
_scratch_unmount
|
|
|
|
if [ "$FSTYP" == "xfs" ]; then
|
|
_check_dmesg _filter_xfs_dmesg
|
|
else
|
|
_check_dmesg
|
|
fi
|
|
status=$?
|
|
exit
|