tests: remove udf/101
[xfstests-dev.git] / tests / generic / 438
1 #! /bin/bash
2 # FS QA Test 438
3 #
4 # This is a regression test for kernel patch
5 #   "ext4: Fix data corruption for mmap writes"
6 #
7 # The problem this test checks for is when too much is zeroed in the tail
8 # page that gets written out just while the file gets extended and written
9 # to through mmap.
10 #
11 # Based on test program by Michael Zimmer <michael@swarm64.com>
12 #
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2017 SUSE.  All Rights Reserved.
15 #
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License as
18 # published by the Free Software Foundation.
19 #
20 # This program is distributed in the hope that it would be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 # GNU General Public License for more details.
24 #
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write the Free Software Foundation,
27 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
28 #-----------------------------------------------------------------------
29 #
30
31 seq=`basename $0`
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
34
35 here=`pwd`
36 tmp=/tmp/$$
37 status=1        # failure is the default!
38 trap "_cleanup; exit \$status" 0 1 2 3 15
39
40 _cleanup()
41 {
42         cd /
43         rm -f $tmp.*
44         rm -f $FILE
45 }
46
47 # get standard environment, filters and checks
48 . ./common/rc
49 . ./common/filter
50
51 # remove previous $seqres.full before test
52 rm -f $seqres.full
53
54 # Modify as appropriate.
55 _supported_fs generic
56 _supported_os Linux
57 _require_test
58 _require_test_program "t_mmap_fallocate"
59
60 # real QA test starts here
61 FILE=$TEST_DIR/testfile_fallocate
62 # Make sure file exists
63 echo >$FILE
64 # Force frequent writeback of the file
65 (
66         trap "STOP=1" SIGTERM
67         STOP=0
68         while [ $STOP -eq 0 ]; do
69                 $XFS_IO_PROG -c fsync $FILE
70         done
71 )&
72 SYNCPID=$!
73
74 # Run the test
75 src/t_mmap_fallocate $FILE 256 && echo "Silence is golden"
76
77 kill -TERM $SYNCPID
78 wait $SYNCPID
79
80 # success, all done
81 status=0
82 exit