generic/611: Use _getfattr instead of GETFATTR_PROG
[xfstests-dev.git] / tests / generic / 503
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Intel Corporation.  All Rights Reserved.
4 #
5 # FS QA Test No. 503
6 #
7 # This is a regression test for kernel patch:
8 #   ext4: handle layout changes to pinned DAX mapping
9 #
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.
15
16 seq=`basename $0`
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
19
20 here=`pwd`
21 tmp=/tmp/$$
22 status=1        # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
24
25 _cleanup()
26 {
27         cd /
28         rm -f $tmp.*
29 }
30
31 # get standard environment, filters and checks
32 . ./common/rc
33 . ./common/filter
34
35 # remove previous $seqres.full before test
36 rm -f $seqres.full
37
38 # Modify as appropriate.
39 _supported_fs generic
40 _require_test
41 _require_scratch
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"
47
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
56
57 # real QA test starts here
58 $here/src/t_mmap_collision $TEST_DIR/testfile $SCRATCH_MNT/testfile
59
60 # success, all done
61 echo "Silence is golden"
62 status=0
63 exit