2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Oracle, Inc. All Rights Reserved.
7 # Test a specific sequence of fsx operations that causes an mmap read past
8 # eof to return nonzero contents.
11 _begin_fstest auto quick rw zero
13 # Import common functions.
16 # real QA test starts here
19 _require_xfs_io_command "falloc" "-k"
20 _require_xfs_io_command "fzero"
22 _scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1
25 $XFS_IO_PROG -fc "pwrite 0 256m" -c fsync $SCRATCH_MNT/file >>$seqres.full 2>&1
26 rm -f $SCRATCH_MNT/file
28 cat >> $tmp.fsxops << ENDL
29 truncate 0x0 0x1f0d6 0x380e1
30 write 0x1ad87 0x6c99 0x180d6
31 zero_range 0x14426 0xd3aa 0x21a20 keep_size
32 mapread 0x1f69a 0x2386 0x21a20
37 $here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
39 echo "Silence is golden"