blob: a77ff4e8b73730b0886528eeb34a546f3f5097c6 (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017 CTERA Networks. All Rights Reserved.
#
# FS QA Test No. 456
#
# This test is motivated by a bug found in ext4 during random crash
# consistency tests.
#
# Fixed by commit 51e3ae81ec58 ("ext4: fix interaction between i_size,
# fallocate, and delalloc after a crash")
#
# This is also a regression test for ext4 bug that zero range can beyond
# i_disksize and fixed by commit 801674f34ecf ("ext4: do not zeroout extents
# beyond i_disksize").
#
. ./common/preamble
_begin_fstest auto quick metadata collapse zero prealloc
# Override the default cleanup function.
_cleanup()
{
_cleanup_flakey
cd /
rm -f $tmp.*
}
# Import common functions.
. ./common/filter
. ./common/dmflakey
# real QA test starts here
_supported_fs generic
_require_scratch
_require_xfs_io_command "falloc"
_require_dm_target flakey
_require_xfs_io_command "falloc" "-k"
_require_xfs_io_command "fzero"
_require_xfs_io_command "fcollapse"
_scratch_mkfs >> $seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_init_flakey
_mount_flakey
# See this post for reverse engineering of this auto generated test:
# https://marc.info/?l=linux-ext4&m=151137380830381&w=2
fsxops=$tmp.fsxops
cat <<EOF > $fsxops
write 0x137dd 0xdc69 0x0
fallocate 0xb531 0xb5ad 0x21446
collapse_range 0x1c000 0x4000 0x21446
write 0x3e5ec 0x1a14 0x21446
zero_range 0x20fac 0x6d9c 0x40000 keep_size
mapwrite 0x216ad 0x274f 0x40000
EOF
run_check $here/ltp/fsx -d --replay-ops $fsxops $SCRATCH_MNT/testfile
_flakey_drop_and_remount
_unmount_flakey
_cleanup_flakey
_check_scratch_fs
echo "Silence is golden"
status=0
exit
|