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 an issue with overlayfs on kernel < v4.19:
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 _begin_fstest auto quick copyup
17 # Import common functions.
20 # real QA test starts here
22 _fixed_in_kernel_version "v4.19"
25 _require_xfs_io_command "open"
27 _scratch_mkfs >>$seqres.full 2>&1
29 # Create our test files.
30 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
32 echo "This is old news" > $lowerdir/foo
37 # open file for read (rofd)
38 # open file for write (rwfd)
42 $XFS_IO_PROG -r $SCRATCH_MNT/foo \
43 -C "open $SCRATCH_MNT/foo" \
44 -C "pwrite -S 0x61 0 16" \
47 | _filter_xfs_io | _filter_scratch