2 # SPDX-License-Identifier: GPL-2.0
7 # Verify that mtime is updated when writing to mmap-ed pages
10 _begin_fstest auto quick
14 # Override the default cleanup function.
22 # Import common functions.
25 # real QA test starts here
29 echo "Silence is golden."
32 testfile=$TEST_DIR/mmap_mtime_testfile
33 $XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full
36 mtime1=`stat -c %Y $testfile`
37 ctime1=`stat -c %Z $testfile`
38 echo "before mwrite: $mtime1 $ctime1" >> $seqres.full
40 # map read followed by map write to trigger timestamp change
42 $XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile \
45 # sample and verify that timestamps have changed.
46 mtime2=`stat -c %Y $testfile`
47 ctime2=`stat -c %Z $testfile`
48 echo "after mwrite : $mtime2 $ctime2" >> $seqres.full
50 if [ "$mtime1" == "$mtime2" ]; then
51 echo "mtime not updated"
54 if [ "$ctime1" == "$ctime2" ]; then
55 echo "ctime not updated"