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")
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
27 trap "_cleanup; exit \$status" 0 1 2 3 15
29 # get standard environment, filters and checks
34 # real QA test starts here
38 _require_dm_target flakey
39 _require_xfs_io_command "falloc" "-k"
40 _require_xfs_io_command "fzero"
41 _require_xfs_io_command "fcollapse"
45 _scratch_mkfs >> $seqres.full 2>&1
46 _require_metadata_journaling $SCRATCH_DEV
51 # See this post for reverse engineering of this auto generated test:
52 # https://marc.info/?l=linux-ext4&m=151137380830381&w=2
55 write 0x137dd 0xdc69 0x0
56 fallocate 0xb531 0xb5ad 0x21446
57 collapse_range 0x1c000 0x4000 0x21446
58 write 0x3e5ec 0x1a14 0x21446
59 zero_range 0x20fac 0x6d9c 0x40000 keep_size
60 mapwrite 0x216ad 0x274f 0x40000
62 run_check $here/ltp/fsx -d --replay-ops $fsxops $SCRATCH_MNT/testfile
64 _flakey_drop_and_remount
69 echo "Silence is golden"