4 # This is a regression test for kernel patch
5 # "ext4: Fix data corruption for mmap writes"
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
11 # Based on test program by Michael Zimmer <michael@swarm64.com>
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2017 SUSE. All Rights Reserved.
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.
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.
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 #-----------------------------------------------------------------------
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
37 status=1 # failure is the default!
38 trap "_cleanup; exit \$status" 0 1 2 3 15
47 # get standard environment, filters and checks
51 # remove previous $seqres.full before test
54 # Modify as appropriate.
58 _require_test_program "t_mmap_fallocate"
60 # real QA test starts here
61 FILE=$TEST_DIR/testfile_fallocate
62 # Make sure file exists
64 # Force frequent writeback of the file
68 while [ $STOP -eq 0 ]; do
69 $XFS_IO_PROG -c fsync $FILE
75 src/t_mmap_fallocate $FILE 256 && echo "Silence is golden"