summaryrefslogtreecommitdiff
path: root/tests/generic/511
blob: 61c21e42c456e045403262cce40c4792be579a08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Oracle, Inc.  All Rights Reserved.
#
# FS QA Test No. 511
#
# Test a specific sequence of fsx operations that causes an mmap read past
# eof to return nonzero contents.
#
. ./common/preamble
_begin_fstest auto quick rw zero prealloc

# Import common functions.
. ./common/punch

# real QA test starts here
_supported_fs generic
_require_scratch
_require_xfs_io_command "falloc" "-k"
_require_xfs_io_command "fzero"

_scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1
_scratch_mount

$XFS_IO_PROG -fc "pwrite 0 256m" -c fsync $SCRATCH_MNT/file >>$seqres.full 2>&1
rm -f $SCRATCH_MNT/file

cat >> $tmp.fsxops << ENDL
truncate 0x0 0x1f0d6 0x380e1
write 0x1ad87 0x6c99 0x180d6
zero_range 0x14426 0xd3aa 0x21a20 keep_size
mapread 0x1f69a 0x2386 0x21a20
ENDL

victim=$SCRATCH_MNT/a
touch $victim
$here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output

echo "Silence is golden"
status=0
exit