2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017-2018 Intel Corporation. All Rights Reserved.
7 # This is a regression test for kernel patch:
8 # ext4: prevent data corruption with inline data + DAX
9 # created by Ross Zwisler <ross.zwisler@linux.intel.com>
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
30 # remove previous $seqres.full before test
33 # DAX needs to be off so we can create an inode with inline data
34 SAVE_MOUNT_OPTIONS="$MOUNT_OPTIONS"
37 # Modify as appropriate.
39 _require_scratch_dax_mountopt "dax"
40 _require_test_program "t_ext4_dax_inline_corruption"
41 _require_scratch_ext4_feature "inline_data"
43 # real QA test starts here
44 _scratch_mkfs_ext4 -O inline_data > $seqres.full 2>&1
46 TESTFILE=$SCRATCH_MNT/testfile
48 _scratch_mount >> $seqres.full 2>&1
50 echo "Need to make some inline data..." > $TESTFILE
52 export MOUNT_OPTIONS="$SAVE_MOUNT_OPTIONS"
54 _scratch_unmount >> $seqres.full 2>&1
55 _try_scratch_mount "-o dax" >> $seqres.full 2>&1
57 if [[ $? != 0 ]]; then
58 # _require_scratch_dax_mountopt already verified that we could mount with DAX.
59 # Failure here is expected because we have inline data.
60 echo "Silence is golden"
65 $here/src/t_ext4_dax_inline_corruption $TESTFILE
68 echo "Silence is golden"