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 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
14 status=1 # failure is the default!
15 trap "_cleanup; exit \$status" 0 1 2 3 15
23 # get standard environment, filters and checks
27 # real QA test starts here
30 _require_xfs_io_command "falloc" "-k"
31 _require_xfs_io_command "fzero"
35 _scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1
38 $XFS_IO_PROG -fc "pwrite 0 256m" -c fsync $SCRATCH_MNT/file >>$seqres.full 2>&1
39 rm -f $SCRATCH_MNT/file
41 cat >> $tmp.fsxops << ENDL
42 truncate 0x0 0x1f0d6 0x380e1
43 write 0x1ad87 0x6c99 0x180d6
44 zero_range 0x14426 0xd3aa 0x21a20 keep_size
45 mapread 0x1f69a 0x2386 0x21a20
50 $here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
52 echo "Silence is golden"