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 journaling + 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 # Modify as appropriate.
37 _require_test_program "t_ext4_dax_journal_corruption"
38 _require_command "$CHATTR_PROG" chattr
40 # real QA test starts here
41 _scratch_mkfs > $seqres.full 2>&1
43 # In order to get our failure condition consistently we need to turn off
44 # delayed allocation. With delayed allocation on this simple test will pass,
45 # but we would almost certainly see data corruption down the road as the
46 # contents of the journal would conflict with the DAX data.
47 _scratch_mount "-o dax,nodelalloc" >> $seqres.full 2>&1
49 $here/src/t_ext4_dax_journal_corruption $CHATTR_PROG $SCRATCH_MNT/testfile
51 if [[ $? != 0 && $? != 77 ]]; then
52 echo "Test failed, status $?"
57 echo "Silence is golden"