mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
aefa911834
overlay/016 tests two cases of ro/rw fd data inconsistecies - one using pread and one using mmap read (i.e. mread). The first case now passes with stacked overlay file operations patch set merged. The second case will still fail. By splitting the two test cases we get one regression test for the common case of ro/rw fd data inconsistecy with pread and one test to track the remaining non-standard behavior of overlayfs w.r.t mmap. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
65 lines
1.2 KiB
Bash
Executable File
65 lines
1.2 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2016 CTERA Networks. All Rights Reserved.
|
|
#
|
|
# FSQA Test No. 016
|
|
#
|
|
# Test ro/rw fd data inconsistecies
|
|
#
|
|
# This simple test demonstrates a known issue with overlayfs:
|
|
# - process A opens file F for read
|
|
# - process B writes new data to file F
|
|
# - process A reads old data from file F
|
|
#
|
|
seq=`basename $0`
|
|
seqres=$RESULT_DIR/$seq
|
|
echo "QA output created by $seq"
|
|
|
|
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 overlay
|
|
_supported_os Linux
|
|
_require_scratch
|
|
_require_xfs_io_command "open"
|
|
|
|
rm -f $seqres.full
|
|
|
|
_scratch_mkfs >>$seqres.full 2>&1
|
|
|
|
# Create our test files.
|
|
lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
|
|
mkdir -p $lowerdir
|
|
echo "This is old news" > $lowerdir/foo
|
|
|
|
_scratch_mount
|
|
|
|
|
|
#
|
|
# open file for read (rofd)
|
|
# open file for write (rwfd)
|
|
# write to rwfd
|
|
# read from rofd
|
|
#
|
|
$XFS_IO_PROG -r $SCRATCH_MNT/foo \
|
|
-C "open $SCRATCH_MNT/foo" \
|
|
-C "pwrite -S 0x61 0 16" \
|
|
-C "file 0" \
|
|
-C "pread -v 0 16" \
|
|
| _filter_xfs_io | _filter_scratch
|
|
|
|
status=0
|
|
exit
|