4 # Test out c/mtime updates after mapped writes.
6 # Based on the testcase in http://bugzilla.kernel.org/show_bug.cgi?id=2645
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2009 Christoph Hellwig.
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
27 seqres=$RESULT_DIR/$seq
28 seqres=$RESULT_DIR/$seq
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
40 status=1 # failure is the default!
41 trap "_cleanup; exit \$status" 0 1 2 3 15
43 # get standard environment, filters and checks
47 # real QA test starts here
51 testfile=$TEST_DIR/tst.mmap
54 echo "creating test file"
55 dd if=/dev/zero of=$testfile count=4096
57 mtime1=`stat --printf="%Y" $testfile`
58 ctime1=`stat --printf="%Z" $testfile`
63 echo "writing via mmap"
67 $testfile | _filter_xfs_io_unique
69 mtime2=`stat --printf="%Y" $testfile`
70 ctime2=`stat --printf="%Z" $testfile`
72 let mtime_diff=$mtime2-$mtime1
73 let ctime_diff=$ctime2-$ctime1
75 if [ "$mtime_diff" -eq "0" ]; then
76 echo "FAIL: mtime not update after mapped write"
79 if [ "$ctime_diff" -eq "0" ]; then
80 echo "FAIL: ctime not update after mapped write"