4 # Verify that mtime is updated when writing to mmap-ed pages
6 #-----------------------------------------------------------------------
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation.
11 # This program is distributed in the hope that it would be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write the Free Software Foundation,
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 seqres=$RESULT_DIR/$seq
24 echo "QA output created by $seq"
29 trap "_cleanup; exit \$status" 0 1 2 3 15
38 # get standard environment, filters and checks
42 # real QA test starts here
47 echo "Silence is golden."
51 testfile=$TEST_DIR/mmap_mtime_testfile
52 $XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full
55 mtime1=`stat -c %Y $testfile`
56 ctime1=`stat -c %Z $testfile`
57 echo "before mwrite: $mtime1 $ctime1" >> $seqres.full
59 # map read followed by map write to trigger timestamp change
61 $XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile \
64 # sample and verify that timestamps have changed.
65 mtime2=`stat -c %Y $testfile`
66 ctime2=`stat -c %Z $testfile`
67 echo "after mwrite : $mtime2 $ctime2" >> $seqres.full
69 if [ "$mtime1" == "$mtime2" ]; then
70 echo "mtime not updated"
73 if [ "$ctime1" == "$ctime2" ]; then
74 echo "ctime not updated"