2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2017 CTERA Networks. All Rights Reserved.
7 # This test is motivated by a bug found in ext4 during random crash
10 # Fixed by commit 51e3ae81ec58 ("ext4: fix interaction between i_size,
11 # fallocate, and delalloc after a crash")
13 # This is also a regression test for ext4 bug that zero range can beyond
14 # i_disksize and fixed by commit 801674f34ecf ("ext4: do not zeroout extents
15 # beyond i_disksize").
18 seqres=$RESULT_DIR/$seq
19 echo "QA output created by $seq"
23 status=1 # failure is the default!
31 trap "_cleanup; exit \$status" 0 1 2 3 15
33 # get standard environment, filters and checks
38 # real QA test starts here
42 _require_dm_target flakey
43 _require_xfs_io_command "falloc" "-k"
44 _require_xfs_io_command "fzero"
45 _require_xfs_io_command "fcollapse"
49 _scratch_mkfs >> $seqres.full 2>&1
50 _require_metadata_journaling $SCRATCH_DEV
55 # See this post for reverse engineering of this auto generated test:
56 # https://marc.info/?l=linux-ext4&m=151137380830381&w=2
59 write 0x137dd 0xdc69 0x0
60 fallocate 0xb531 0xb5ad 0x21446
61 collapse_range 0x1c000 0x4000 0x21446
62 write 0x3e5ec 0x1a14 0x21446
63 zero_range 0x20fac 0x6d9c 0x40000 keep_size
64 mapwrite 0x216ad 0x274f 0x40000
66 run_check $here/ltp/fsx -d --replay-ops $fsxops $SCRATCH_MNT/testfile
68 _flakey_drop_and_remount
73 echo "Silence is golden"