4 # Test ro/rw fd data inconsistecies
6 # This simple test demonstrates a known issue with overlayfs:
7 # - process A opens file F for read
8 # - process B writes new data to file F
9 # - process A reads old data from file F
11 #-----------------------------------------------------------------------
13 # Copyright (C) 2016 CTERA Networks. All Rights Reserved.
14 # Author: Amir Goldstein <amir73il@gmail.com>
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License as
18 # published by the Free Software Foundation.
20 # This program is distributed in the hope that it would be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write the Free Software Foundation,
27 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #-----------------------------------------------------------------------
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
36 status=1 # failure is the default!
37 trap "_cleanup; exit \$status" 0 1 2 3 15
45 # get standard environment, filters and checks
49 # real QA test starts here
56 _scratch_mkfs >>$seqres.full 2>&1
58 # Create our test files.
59 lowerdir=$SCRATCH_DEV/$OVERLAY_LOWER_DIR
61 echo "This is old news" > $lowerdir/foo
62 echo "This is old news" > $lowerdir/bar
70 # open file for read (rofd)
71 # open file for write (rwfd)
75 $XFS_IO_PROG << EOF | _filter_xfs_io
85 # mmap MAP_SHARED|PROT_READ of rofd
87 # read from mapped memory
89 $XFS_IO_PROG << EOF | _filter_xfs_io