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 #-----------------------------------------------------------------------
29 echo "QA output created by $seq"
39 status=1 # failure is the default!
40 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
46 # real QA test starts here
50 testfile=$TEST_DIR/tst.mmap
53 echo "creating test file"
54 dd if=/dev/zero of=$testfile count=4096
56 mtime1=`stat --printf="%Y" $testfile`
57 ctime1=`stat --printf="%Z" $testfile`
62 echo "writing via mmap"
66 $testfile | _filter_xfs_io_unique
68 mtime2=`stat --printf="%Y" $testfile`
69 ctime2=`stat --printf="%Z" $testfile`
71 let mtime_diff=$mtime2-$mtime1
72 let ctime_diff=$ctime2-$ctime1
74 if [ "$mtime_diff" -eq "0" ]; then
75 echo "FAIL: mtime not update after mapped write"
78 if [ "$ctime_diff" -eq "0" ]; then
79 echo "FAIL: ctime not update after mapped write"