2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2016 CTERA Networks. All Rights Reserved.
7 # Test ro/rw fd data inconsistecies
9 # This simple test demonstrates a known issue with overlayfs:
10 # - process A opens file F for read
11 # - process B writes new data to file F
12 # - process A reads old data from file F
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
19 status=1 # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
28 # get standard environment, filters and checks
32 # real QA test starts here
36 _require_xfs_io_command "open"
40 _scratch_mkfs >>$seqres.full 2>&1
42 # Create our test files.
43 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
45 echo "This is old news" > $lowerdir/foo
51 # open file for read (rofd)
52 # open file for write (rwfd)
56 $XFS_IO_PROG -r $SCRATCH_MNT/foo \
57 -C "open $SCRATCH_MNT/foo" \
58 -C "pwrite -S 0x61 0 16" \
61 | _filter_xfs_io | _filter_scratch