xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / overlay / 016
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2016 CTERA Networks. All Rights Reserved.
4 #
5 # FSQA Test No. 016
6 #
7 # Test ro/rw fd data inconsistecies
8 #
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
13 #
14 seq=`basename $0`
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
17
18 tmp=/tmp/$$
19 status=1        # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24         cd /
25         rm -f $tmp.*
26 }
27
28 # get standard environment, filters and checks
29 . ./common/rc
30 . ./common/filter
31
32 # real QA test starts here
33 _supported_fs overlay
34 _supported_os Linux
35 _require_scratch
36 _require_xfs_io_command "open"
37
38 rm -f $seqres.full
39
40 _scratch_mkfs >>$seqres.full 2>&1
41
42 # Create our test files.
43 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
44 mkdir -p $lowerdir
45 echo "This is old news" > $lowerdir/foo
46
47 _scratch_mount
48
49
50 #
51 # open file for read (rofd)
52 # open file for write (rwfd)
53 # write to rwfd
54 # read from rofd
55 #
56 $XFS_IO_PROG -r $SCRATCH_MNT/foo \
57         -C "open $SCRATCH_MNT/foo" \
58         -C "pwrite -S 0x61 0 16" \
59         -C "file 0" \
60         -C "pread -v 0 16" \
61 | _filter_xfs_io | _filter_scratch
62
63 status=0
64 exit