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
34 testfile=$TEST_DIR/tst.mmap
37 echo "creating test file"
38 dd if=/dev/zero of=$testfile count=4096
40 mtime1=`stat -c "%Y" $testfile`
41 ctime1=`stat -c "%Z" $testfile`
46 echo "writing via mmap"
50 $testfile | _filter_xfs_io_unique
52 mtime2=`stat -c "%Y" $testfile`
53 ctime2=`stat -c "%Z" $testfile`
55 let mtime_diff=$mtime2-$mtime1
56 let ctime_diff=$ctime2-$ctime1
58 if [ "$mtime_diff" -eq "0" ]; then
59 echo "FAIL: mtime not update after mapped write"
62 if [ "$ctime_diff" -eq "0" ]; then
63 echo "FAIL: ctime not update after mapped write"