2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Christoph Hellwig.
7 # Test out c/mtime updates after mapped writes.
9 # Based on the testcase in http://bugzilla.kernel.org/show_bug.cgi?id=2645
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
23 status=1 # failure is the default!
24 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
30 # real QA test starts here
35 testfile=$TEST_DIR/tst.mmap
38 echo "creating test file"
39 dd if=/dev/zero of=$testfile count=4096
41 mtime1=`stat -c "%Y" $testfile`
42 ctime1=`stat -c "%Z" $testfile`
47 echo "writing via mmap"
51 $testfile | _filter_xfs_io_unique
53 mtime2=`stat -c "%Y" $testfile`
54 ctime2=`stat -c "%Z" $testfile`
56 let mtime_diff=$mtime2-$mtime1
57 let ctime_diff=$ctime2-$ctime1
59 if [ "$mtime_diff" -eq "0" ]; then
60 echo "FAIL: mtime not update after mapped write"
63 if [ "$ctime_diff" -eq "0" ]; then
64 echo "FAIL: ctime not update after mapped write"