2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Intel Corporation. All Rights Reserved.
7 # This is a regression test for kernel patch:
8 # ext4: handle layout changes to pinned DAX mapping
10 # This test exercises each of the DAX paths in ext4 which remove blocks from
11 # an inode's block map. This includes things like hole punch, truncate down,
12 # etc. This test was written to regression test errors seen with an ext4 +
13 # DAX setup, but the test runs fine with or without DAX and with XFS so we
14 # don't require the DAX mount option or a specific filesystem for the test.
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
22 status=1 # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
31 # get standard environment, filters and checks
35 # remove previous $seqres.full before test
38 # Modify as appropriate.
42 _require_test_program "t_mmap_collision"
43 _require_xfs_io_command "falloc"
44 _require_xfs_io_command "fpunch"
45 _require_xfs_io_command "fcollapse"
46 _require_xfs_io_command "fzero"
48 _scratch_mkfs >> $seqres.full 2>&1
49 # To get the failure we turn off DAX on our SCRATCH_MNT so we can get O_DIRECT
50 # behavior. We will continue to use unmodified mount options for the test
51 # TEST_DIR. The failures fixed by the above mentioned kernel patch trigger
52 # when those mount options include "-o dax", but the test runs fine without
53 # that option so we don't require it.
54 export MOUNT_OPTIONS=""
55 _scratch_mount >> $seqres.full 2>&1
57 # real QA test starts here
58 $here/src/t_mmap_collision $TEST_DIR/testfile $SCRATCH_MNT/testfile
61 echo "Silence is golden"