2 # SPDX-License-Identifier: GPL-2.0
7 # Verify that mtime is updated when writing to mmap-ed pages
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
16 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
29 # real QA test starts here
33 echo "Silence is golden."
37 testfile=$TEST_DIR/mmap_mtime_testfile
38 $XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full
41 mtime1=`stat -c %Y $testfile`
42 ctime1=`stat -c %Z $testfile`
43 echo "before mwrite: $mtime1 $ctime1" >> $seqres.full
45 # map read followed by map write to trigger timestamp change
47 $XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile \
50 # sample and verify that timestamps have changed.
51 mtime2=`stat -c %Y $testfile`
52 ctime2=`stat -c %Z $testfile`
53 echo "after mwrite : $mtime2 $ctime2" >> $seqres.full
55 if [ "$mtime1" == "$mtime2" ]; then
56 echo "mtime not updated"
59 if [ "$ctime1" == "$ctime2" ]; then
60 echo "ctime not updated"