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 collapse zero
13 # Import common functions.
16 # real QA test starts here
19 _require_xfs_io_command "falloc" "-k"
20 _require_xfs_io_command "fcollapse"
21 _require_xfs_io_command "fzero"
23 _scratch_mkfs >>$seqres.full 2>&1
26 cat >> $tmp.fsxops << ENDL
27 fallocate 0x77e2 0x5f06 0x269a2 keep_size
28 mapwrite 0x2e7fc 0x42ba 0x3f989
29 write 0x67a9 0x714e 0x3f989
30 write 0x39f96 0x185a 0x3f989
31 collapse_range 0x36000 0x8000 0x3f989
32 mapread 0x74c0 0x1bb3 0x3e2d0
33 truncate 0x0 0x8aa2 0x3e2d0
34 zero_range 0x1265 0x783d 0x8aa2
35 mapread 0x7bd8 0xeca 0x8aa2
40 $here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
42 echo "Silence is golden"