ext4/027: Correct the right code of block and inode bitmap
[xfstests-dev.git] / tests / ext4 / 030
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017-2018 Intel Corporation.  All Rights Reserved.
4 #
5 # FS QA Test ext4/030
6 #
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>
10 #
11 . ./common/preamble
12 _begin_fstest auto quick dax
13
14 # Import common functions.
15 . ./common/filter
16
17 # Modify as appropriate.
18 _supported_fs ext4
19 _require_scratch_dax_mountopt "dax"
20 _require_test_program "t_ext4_dax_journal_corruption"
21 _require_command "$CHATTR_PROG" chattr
22
23 # real QA test starts here
24 _scratch_mkfs > $seqres.full 2>&1
25
26 # In order to get our failure condition consistently we need to turn off
27 # delayed allocation.  With delayed allocation on this simple test will pass,
28 # but we would almost certainly see data corruption down the road as the
29 # contents of the journal would conflict with the DAX data.
30 _scratch_mount "-o dax,nodelalloc" >> $seqres.full 2>&1
31
32 $here/src/t_ext4_dax_journal_corruption $CHATTR_PROG $SCRATCH_MNT/testfile
33
34 if [[ $? != 0 && $? != 77 ]]; then
35         echo "Test failed, status $?"
36         exit 1
37 fi
38
39 # success, all done
40 echo "Silence is golden"
41 status=0
42 exit