* Re: [PATCH 1/3 v2] xfstest: generic/080 test that mmap-write updates c/mtime [not found] ` <54F861F3.9000805@plexistor.com> @ 2015-03-05 14:12 ` Boaz Harrosh 0 siblings, 0 replies; 8+ messages in thread From: Boaz Harrosh @ 2015-03-05 14:12 UTC (permalink / raw) To: Boaz Harrosh, Dave Chinner Cc: Matthew Wilcox, Andrew Morton, Kirill A. Shutemov, Jan Kara, Hugh Dickins, Mel Gorman, linux-mm, linux-nvdimm, linux-fsdevel, Omer Zilberberg, fstests I again forgot to CC: fstests@vger.kernel.org Thanks Boaz On 03/05/2015 04:02 PM, Boaz Harrosh wrote: > From: Dave Chinner <dchinner@redhat.com> > > when using mmap() for file i/o, writing to the file should update > it's c/mtime. Specifically if we first mmap-read from a page, then > memap-write to the same page. > > This test was failing for the initial submission of DAX because > pfn based mapping do not have an page_mkwrite called for them. > The new Kernel patches that introduce pfn_mkwrite fixes this test. > > Written by Dave Chinner but edited and tested by: > Omer Zilberberg > > Tested-by: Omer Zilberberg <omzg@plexistor.com> > Signed-off-by: Omer Zilberberg <omzg@plexistor.com> > Signed-off-by: Boaz Harrosh <boaz@plexistor.com> > --- > Dave hands-up man, it looks like you edited this directly > in the email, but there was not even a single typo. > > We have tested this both with and without the pfn_mkwrite patch. > And it works as expected fails without and success with. > > Thanks > > tests/generic/080 | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/generic/080.out | 2 ++ > tests/generic/group | 1 + > 3 files changed, 82 insertions(+) > create mode 100755 tests/generic/080 > create mode 100644 tests/generic/080.out > > diff --git a/tests/generic/080 b/tests/generic/080 > new file mode 100755 > index 0000000..2bc580d > --- /dev/null > +++ b/tests/generic/080 > @@ -0,0 +1,79 @@ > +#! /bin/bash > +# FS QA Test No. 080 > +# > +# Verify that mtime is updated when writing to mmap-ed pages > +# > +#----------------------------------------------------------------------- > +# This program is free software; you can redistribute it and/or > +# modify it under the terms of the GNU General Public License as > +# published by the Free Software Foundation. > +# > +# This program is distributed in the hope that it would be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write the Free Software Foundation, > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > +#----------------------------------------------------------------------- > +# > + > +seq=`basename $0` > +seqres=$RESULT_DIR/$seq > +echo "QA output created by $seq" > + > +here=`pwd` > +tmp=/tmp/$$ > +status=0 > +trap "_cleanup; exit \$status" 0 1 2 3 15 > + > +_cleanup() > +{ > + cd / > + rm -f $tmp.* > + rm -f $TEST_DIR/mmap_mtime_testfile > +} > + > +# get standard environment, filters and checks > +. ./common/rc > +. ./common/filter > + > +# real QA test starts here > + > +# Modify as appropriate. > +_supported_fs generic > +_supported_os IRIX Linux > +_require_test > + > +echo "Silence is golden." > +rm -f $seqres.full > + > +# pattern the file. > +testfile=$TEST_DIR/mmap_mtime_testfile > +$XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full > + > +# sample timestamps. > +mtime1=`stat -c %Y $testfile` > +ctime1=`stat -c %Z $testfile` > +echo "before mwrite: $mtime1 $ctime1" >> $seqres.full > + > +# map read followed by map write to trigger timestamp change > +sleep 2 > +$XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile |_filter_xfs_io >> $seqres.full > + > +# sample and verify that timestamps have changed. > +mtime2=`stat -c %Y $testfile` > +ctime2=`stat -c %Z $testfile` > +echo "after mwrite : $mtime2 $ctime2" >> $seqres.full > + > +if [ "$mtime1" == "$mtime2" ]; then > + echo "mtime not updated" > + let status=$status+1 > +fi > +if [ "$ctime1" == "$ctime2" ]; then > + echo "ctime not updated" > + let status=$status+1 > +fi > + > +exit > diff --git a/tests/generic/080.out b/tests/generic/080.out > new file mode 100644 > index 0000000..cccac52 > --- /dev/null > +++ b/tests/generic/080.out > @@ -0,0 +1,2 @@ > +QA output created by 080 > +Silence is golden. > diff --git a/tests/generic/group b/tests/generic/group > index 11ce3e4..7ee5cdc 100644 > --- a/tests/generic/group > +++ b/tests/generic/group > @@ -77,6 +77,7 @@ > 076 metadata rw udf auto quick stress > 077 acl attr auto enospc > 079 acl attr ioctl metadata auto quick > +080 auto quick > 083 rw auto enospc stress > 088 perms auto quick > 089 metadata auto > ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3 v2 resend] xfstest: generic/080 test that mmap-write updates c/mtime [not found] ` <20150305001312.GA4251@dastard> [not found] ` <54F861F3.9000805@plexistor.com> @ 2015-03-19 9:53 ` Boaz Harrosh 2015-03-19 10:44 ` Eryu Guan 1 sibling, 1 reply; 8+ messages in thread From: Boaz Harrosh @ 2015-03-19 9:53 UTC (permalink / raw) To: Dave Chinner; +Cc: Matthew Wilcox, linux-fsdevel, fstests From: Dave Chinner <dchinner@redhat.com> when using mmap() for file i/o, writing to the file should update it's c/mtime. Specifically if we first mmap-read from a page, then memap-write to the same page. This test was failing for the initial submission of DAX because pfn based mapping do not have an page_mkwrite called for them. The new Kernel patches that introduce pfn_mkwrite fixes this test. Written by Dave Chinner but edited and tested by: Omer Zilberberg Tested-by: Omer Zilberberg <omzg@plexistor.com> Tested-by: Boaz Harrosh <boaz@plexistor.com> Signed-off-by: Omer Zilberberg <omzg@plexistor.com> Signed-off-by: Boaz Harrosh <boaz@plexistor.com> --- Dave hands-up man, it looks like you edited this directly in the email, but there was not even a single typo. We have tested this both with and without the pfn_mkwrite patch. And it works as expected fails without and success with. Thanks tests/generic/080 | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/080.out | 2 ++ tests/generic/group | 1 + 3 files changed, 82 insertions(+) create mode 100755 tests/generic/080 create mode 100644 tests/generic/080.out diff --git a/tests/generic/080 b/tests/generic/080 new file mode 100755 index 0000000..2bc580d --- /dev/null +++ b/tests/generic/080 @@ -0,0 +1,79 @@ +#! /bin/bash +# FS QA Test No. 080 +# +# Verify that mtime is updated when writing to mmap-ed pages +# +#----------------------------------------------------------------------- +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* + rm -f $TEST_DIR/mmap_mtime_testfile +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here + +# Modify as appropriate. +_supported_fs generic +_supported_os IRIX Linux +_require_test + +echo "Silence is golden." +rm -f $seqres.full + +# pattern the file. +testfile=$TEST_DIR/mmap_mtime_testfile +$XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full + +# sample timestamps. +mtime1=`stat -c %Y $testfile` +ctime1=`stat -c %Z $testfile` +echo "before mwrite: $mtime1 $ctime1" >> $seqres.full + +# map read followed by map write to trigger timestamp change +sleep 2 +$XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile |_filter_xfs_io >> $seqres.full + +# sample and verify that timestamps have changed. +mtime2=`stat -c %Y $testfile` +ctime2=`stat -c %Z $testfile` +echo "after mwrite : $mtime2 $ctime2" >> $seqres.full + +if [ "$mtime1" == "$mtime2" ]; then + echo "mtime not updated" + let status=$status+1 +fi +if [ "$ctime1" == "$ctime2" ]; then + echo "ctime not updated" + let status=$status+1 +fi + +exit diff --git a/tests/generic/080.out b/tests/generic/080.out new file mode 100644 index 0000000..cccac52 --- /dev/null +++ b/tests/generic/080.out @@ -0,0 +1,2 @@ +QA output created by 080 +Silence is golden. diff --git a/tests/generic/group b/tests/generic/group index 11ce3e4..7ee5cdc 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -77,6 +77,7 @@ 076 metadata rw udf auto quick stress 077 acl attr auto enospc 079 acl attr ioctl metadata auto quick +080 auto quick 083 rw auto enospc stress 088 perms auto quick 089 metadata auto -- 1.9.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3 v2 resend] xfstest: generic/080 test that mmap-write updates c/mtime 2015-03-19 9:53 ` [PATCH 1/3 v2 resend] " Boaz Harrosh @ 2015-03-19 10:44 ` Eryu Guan 2015-03-19 11:46 ` [PATCH v3] " Boaz Harrosh 0 siblings, 1 reply; 8+ messages in thread From: Eryu Guan @ 2015-03-19 10:44 UTC (permalink / raw) To: Boaz Harrosh; +Cc: Dave Chinner, Matthew Wilcox, linux-fsdevel, fstests On Thu, Mar 19, 2015 at 11:53:08AM +0200, Boaz Harrosh wrote: > From: Dave Chinner <dchinner@redhat.com> > > when using mmap() for file i/o, writing to the file should update > it's c/mtime. Specifically if we first mmap-read from a page, then > memap-write to the same page. > > This test was failing for the initial submission of DAX because > pfn based mapping do not have an page_mkwrite called for them. > The new Kernel patches that introduce pfn_mkwrite fixes this test. > > Written by Dave Chinner but edited and tested by: > Omer Zilberberg > > Tested-by: Omer Zilberberg <omzg@plexistor.com> > Tested-by: Boaz Harrosh <boaz@plexistor.com> > Signed-off-by: Omer Zilberberg <omzg@plexistor.com> > Signed-off-by: Boaz Harrosh <boaz@plexistor.com> > --- > Dave hands-up man, it looks like you edited this directly > in the email, but there was not even a single typo. > > We have tested this both with and without the pfn_mkwrite patch. > And it works as expected fails without and success with. > > Thanks > > tests/generic/080 | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/generic/080.out | 2 ++ > tests/generic/group | 1 + This update to group file makes git am to fail on current HEAD 7a1ad74 common: fix "utility required warning" with empty utility name Applying: xfstest: generic/080 test that mmap-write updates c/mtime error: patch failed: tests/generic/group:77 error: tests/generic/group: patch does not apply Patch failed at 0001 xfstest: generic/080 test that mmap-write updates c/mtime > 3 files changed, 82 insertions(+) > create mode 100755 tests/generic/080 > create mode 100644 tests/generic/080.out > > diff --git a/tests/generic/080 b/tests/generic/080 > new file mode 100755 > index 0000000..2bc580d > --- /dev/null > +++ b/tests/generic/080 > @@ -0,0 +1,79 @@ > +#! /bin/bash > +# FS QA Test No. 080 > +# > +# Verify that mtime is updated when writing to mmap-ed pages > +# > +#----------------------------------------------------------------------- > +# This program is free software; you can redistribute it and/or > +# modify it under the terms of the GNU General Public License as > +# published by the Free Software Foundation. > +# > +# This program is distributed in the hope that it would be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write the Free Software Foundation, > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > +#----------------------------------------------------------------------- > +# > + > +seq=`basename $0` > +seqres=$RESULT_DIR/$seq > +echo "QA output created by $seq" > + > +here=`pwd` > +tmp=/tmp/$$ > +status=0 > +trap "_cleanup; exit \$status" 0 1 2 3 15 > + > +_cleanup() > +{ > + cd / > + rm -f $tmp.* > + rm -f $TEST_DIR/mmap_mtime_testfile rm -f $testfile ? as you have testfile defined Also please use single tab to indent, not 4 spaces (the 'new' script has been fixed too) > +} > + > +# get standard environment, filters and checks > +. ./common/rc > +. ./common/filter > + > +# real QA test starts here > + > +# Modify as appropriate. This comment can be removed. > +_supported_fs generic > +_supported_os IRIX Linux > +_require_test > + > +echo "Silence is golden." > +rm -f $seqres.full > + > +# pattern the file. > +testfile=$TEST_DIR/mmap_mtime_testfile > +$XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full > + > +# sample timestamps. > +mtime1=`stat -c %Y $testfile` > +ctime1=`stat -c %Z $testfile` > +echo "before mwrite: $mtime1 $ctime1" >> $seqres.full > + > +# map read followed by map write to trigger timestamp change > +sleep 2 > +$XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile |_filter_xfs_io >> $seqres.full _filter_xfs_io seems unnecessary, the output is not going to .out file but to $seqres.full Thanks, Eryu Guan > + > +# sample and verify that timestamps have changed. > +mtime2=`stat -c %Y $testfile` > +ctime2=`stat -c %Z $testfile` > +echo "after mwrite : $mtime2 $ctime2" >> $seqres.full > + > +if [ "$mtime1" == "$mtime2" ]; then > + echo "mtime not updated" > + let status=$status+1 > +fi > +if [ "$ctime1" == "$ctime2" ]; then > + echo "ctime not updated" > + let status=$status+1 > +fi > + > +exit > diff --git a/tests/generic/080.out b/tests/generic/080.out > new file mode 100644 > index 0000000..cccac52 > --- /dev/null > +++ b/tests/generic/080.out > @@ -0,0 +1,2 @@ > +QA output created by 080 > +Silence is golden. > diff --git a/tests/generic/group b/tests/generic/group > index 11ce3e4..7ee5cdc 100644 > --- a/tests/generic/group > +++ b/tests/generic/group > @@ -77,6 +77,7 @@ > 076 metadata rw udf auto quick stress > 077 acl attr auto enospc > 079 acl attr ioctl metadata auto quick > +080 auto quick > 083 rw auto enospc stress > 088 perms auto quick > 089 metadata auto > -- > 1.9.3 > > -- > To unsubscribe from this list: send the line "unsubscribe fstests" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3] xfstest: generic/080 test that mmap-write updates c/mtime 2015-03-19 10:44 ` Eryu Guan @ 2015-03-19 11:46 ` Boaz Harrosh 2015-03-19 11:49 ` Boaz Harrosh 2015-03-19 15:30 ` Eryu Guan 0 siblings, 2 replies; 8+ messages in thread From: Boaz Harrosh @ 2015-03-19 11:46 UTC (permalink / raw) To: Eryu Guan, Boaz Harrosh, Dave Chinner Cc: Matthew Wilcox, linux-fsdevel, fstests From: Dave Chinner <dchinner@redhat.com> when using mmap() for file i/o, writing to the file should update it's c/mtime. Specifically if we first mmap-read from a page, then memap-write to the same page. This test was failing for the initial submission of DAX because pfn based mapping do not have an page_mkwrite called for them. The new Kernel patches that introduce pfn_mkwrite fixes this test. Written by Dave Chinner but edited and tested by: Omer Zilberberg Dave hands-up man, it looks like you edited this directly in the email, but there was not even a single typo. Tested-by: Omer Zilberberg <omzg@plexistor.com> Tested-by: Boaz Harrosh <boaz@plexistor.com> Signed-off-by: Omer Zilberberg <omzg@plexistor.com> Signed-off-by: Boaz Harrosh <boaz@plexistor.com> Need-Reviewed-by: Eryu Guan <eguan@redhat.com> --- tests/generic/080 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/080.out | 2 ++ tests/generic/group | 1 + 3 files changed, 80 insertions(+) create mode 100755 tests/generic/080 create mode 100644 tests/generic/080.out diff --git a/tests/generic/080 b/tests/generic/080 new file mode 100755 index 0000000..bb9d552 --- /dev/null +++ b/tests/generic/080 @@ -0,0 +1,77 @@ +#! /bin/bash +# FS QA Test No. 080 +# +# Verify that mtime is updated when writing to mmap-ed pages +# +#----------------------------------------------------------------------- +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* + rm -f $testfile +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs generic +_supported_os IRIX Linux +_require_test + +echo "Silence is golden." +rm -f $seqres.full + +# pattern the file. +testfile=$TEST_DIR/mmap_mtime_testfile +$XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full + +# sample timestamps. +mtime1=`stat -c %Y $testfile` +ctime1=`stat -c %Z $testfile` +echo "before mwrite: $mtime1 $ctime1" >> $seqres.full + +# map read followed by map write to trigger timestamp change +sleep 2 +$XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile >> $seqres.full + +# sample and verify that timestamps have changed. +mtime2=`stat -c %Y $testfile` +ctime2=`stat -c %Z $testfile` +echo "after mwrite : $mtime2 $ctime2" >> $seqres.full + +if [ "$mtime1" == "$mtime2" ]; then + echo "mtime not updated" + let status=$status+1 +fi +if [ "$ctime1" == "$ctime2" ]; then + echo "ctime not updated" + let status=$status+1 +fi + +exit diff --git a/tests/generic/080.out b/tests/generic/080.out new file mode 100644 index 0000000..cccac52 --- /dev/null +++ b/tests/generic/080.out @@ -0,0 +1,2 @@ +QA output created by 080 +Silence is golden. diff --git a/tests/generic/group b/tests/generic/group index d56d3ce..8154401 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -79,6 +79,7 @@ 077 acl attr auto enospc 078 auto quick metadata 079 acl attr ioctl metadata auto quick +080 auto quick 083 rw auto enospc stress 088 perms auto quick 089 metadata auto -- 1.9.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3] xfstest: generic/080 test that mmap-write updates c/mtime 2015-03-19 11:46 ` [PATCH v3] " Boaz Harrosh @ 2015-03-19 11:49 ` Boaz Harrosh 2015-03-19 15:30 ` Eryu Guan 1 sibling, 0 replies; 8+ messages in thread From: Boaz Harrosh @ 2015-03-19 11:49 UTC (permalink / raw) To: Boaz Harrosh, Eryu Guan, Dave Chinner Cc: Matthew Wilcox, linux-fsdevel, fstests On 03/19/2015 01:46 PM, Boaz Harrosh wrote: > From: Dave Chinner <dchinner@redhat.com> > > when using mmap() for file i/o, writing to the file should update > it's c/mtime. Specifically if we first mmap-read from a page, then > memap-write to the same page. > > This test was failing for the initial submission of DAX because > pfn based mapping do not have an page_mkwrite called for them. > The new Kernel patches that introduce pfn_mkwrite fixes this test. > > Written by Dave Chinner but edited and tested by: > Omer Zilberberg > > Dave hands-up man, it looks like you edited this directly > in the email, but there was not even a single typo. > > Tested-by: Omer Zilberberg <omzg@plexistor.com> > Tested-by: Boaz Harrosh <boaz@plexistor.com> > Signed-off-by: Omer Zilberberg <omzg@plexistor.com> > Signed-off-by: Boaz Harrosh <boaz@plexistor.com> > Need-Reviewed-by: Eryu Guan <eguan@redhat.com> Hi Eryu Thank you for your review. I have tried to incorporate your comments, I hope its what you meant. Thanks Boaz ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3] xfstest: generic/080 test that mmap-write updates c/mtime 2015-03-19 11:46 ` [PATCH v3] " Boaz Harrosh 2015-03-19 11:49 ` Boaz Harrosh @ 2015-03-19 15:30 ` Eryu Guan 2015-03-19 15:58 ` [PATCH v4] " Boaz Harrosh 2015-03-19 16:02 ` [PATCH v3] " Boaz Harrosh 1 sibling, 2 replies; 8+ messages in thread From: Eryu Guan @ 2015-03-19 15:30 UTC (permalink / raw) To: Boaz Harrosh; +Cc: Dave Chinner, Matthew Wilcox, linux-fsdevel, fstests On Thu, Mar 19, 2015 at 01:46:40PM +0200, Boaz Harrosh wrote: > From: Dave Chinner <dchinner@redhat.com> > > when using mmap() for file i/o, writing to the file should update > it's c/mtime. Specifically if we first mmap-read from a page, then > memap-write to the same page. > > This test was failing for the initial submission of DAX because > pfn based mapping do not have an page_mkwrite called for them. > The new Kernel patches that introduce pfn_mkwrite fixes this test. > > Written by Dave Chinner but edited and tested by: > Omer Zilberberg > > Dave hands-up man, it looks like you edited this directly > in the email, but there was not even a single typo. > > Tested-by: Omer Zilberberg <omzg@plexistor.com> > Tested-by: Boaz Harrosh <boaz@plexistor.com> > Signed-off-by: Omer Zilberberg <omzg@plexistor.com> > Signed-off-by: Boaz Harrosh <boaz@plexistor.com> > Need-Reviewed-by: Eryu Guan <eguan@redhat.com> checkpatch.pl complains :) WARNING: 'Need-reviewed-by:' is the preferred signature form I tested it with xfs/ext4/btrfs/nfs and cifs, cifs failed the test. The test looks good to me (with one nitpick below). Reviewed-by: Eryu Guan <eguan@redhat.com> > --- > tests/generic/080 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ > tests/generic/080.out | 2 ++ > tests/generic/group | 1 + > 3 files changed, 80 insertions(+) > create mode 100755 tests/generic/080 > create mode 100644 tests/generic/080.out > > diff --git a/tests/generic/080 b/tests/generic/080 > new file mode 100755 > index 0000000..bb9d552 > --- /dev/null > +++ b/tests/generic/080 > @@ -0,0 +1,77 @@ > +#! /bin/bash > +# FS QA Test No. 080 > +# > +# Verify that mtime is updated when writing to mmap-ed pages > +# > +#----------------------------------------------------------------------- > +# This program is free software; you can redistribute it and/or > +# modify it under the terms of the GNU General Public License as > +# published by the Free Software Foundation. > +# > +# This program is distributed in the hope that it would be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write the Free Software Foundation, > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > +#----------------------------------------------------------------------- > +# > + > +seq=`basename $0` > +seqres=$RESULT_DIR/$seq > +echo "QA output created by $seq" > + > +here=`pwd` > +tmp=/tmp/$$ > +status=0 > +trap "_cleanup; exit \$status" 0 1 2 3 15 > + > +_cleanup() > +{ > + cd / > + rm -f $tmp.* > + rm -f $testfile > +} > + > +# get standard environment, filters and checks > +. ./common/rc > +. ./common/filter > + > +# real QA test starts here > +_supported_fs generic > +_supported_os IRIX Linux > +_require_test > + > +echo "Silence is golden." > +rm -f $seqres.full > + > +# pattern the file. > +testfile=$TEST_DIR/mmap_mtime_testfile > +$XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full > + > +# sample timestamps. > +mtime1=`stat -c %Y $testfile` > +ctime1=`stat -c %Z $testfile` > +echo "before mwrite: $mtime1 $ctime1" >> $seqres.full > + > +# map read followed by map write to trigger timestamp change > +sleep 2 > +$XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile >> $seqres.full Better to keep the line within 80 columns. Thanks, Eryu Guan > + > +# sample and verify that timestamps have changed. > +mtime2=`stat -c %Y $testfile` > +ctime2=`stat -c %Z $testfile` > +echo "after mwrite : $mtime2 $ctime2" >> $seqres.full > + > +if [ "$mtime1" == "$mtime2" ]; then > + echo "mtime not updated" > + let status=$status+1 > +fi > +if [ "$ctime1" == "$ctime2" ]; then > + echo "ctime not updated" > + let status=$status+1 > +fi > + > +exit > diff --git a/tests/generic/080.out b/tests/generic/080.out > new file mode 100644 > index 0000000..cccac52 > --- /dev/null > +++ b/tests/generic/080.out > @@ -0,0 +1,2 @@ > +QA output created by 080 > +Silence is golden. > diff --git a/tests/generic/group b/tests/generic/group > index d56d3ce..8154401 100644 > --- a/tests/generic/group > +++ b/tests/generic/group > @@ -79,6 +79,7 @@ > 077 acl attr auto enospc > 078 auto quick metadata > 079 acl attr ioctl metadata auto quick > +080 auto quick > 083 rw auto enospc stress > 088 perms auto quick > 089 metadata auto > -- > 1.9.3 > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v4] xfstest: generic/080 test that mmap-write updates c/mtime 2015-03-19 15:30 ` Eryu Guan @ 2015-03-19 15:58 ` Boaz Harrosh 2015-03-19 16:02 ` [PATCH v3] " Boaz Harrosh 1 sibling, 0 replies; 8+ messages in thread From: Boaz Harrosh @ 2015-03-19 15:58 UTC (permalink / raw) To: Eryu Guan, Dave Chinner; +Cc: Matthew Wilcox, linux-fsdevel, fstests From: Dave Chinner <dchinner@redhat.com> when using mmap() for file i/o, writing to the file should update it's c/mtime. Specifically if we first mmap-read from a page, then memap-write to the same page. This test was failing for the initial submission of DAX because pfn based mapping do not have an page_mkwrite called for them. The new Kernel patches that introduce pfn_mkwrite fixes this test. Written by Dave Chinner but edited and tested by: Omer Zilberberg Dave hands-up man, it looks like you edited this directly in the email, but there was not even a single typo. Tested-by: Omer Zilberberg <omzg@plexistor.com> Tested-by: Boaz Harrosh <boaz@plexistor.com> Signed-off-by: Omer Zilberberg <omzg@plexistor.com> Signed-off-by: Boaz Harrosh <boaz@plexistor.com> Reviewed-by: Eryu Guan <eguan@redhat.com> --- tests/generic/080 | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/080.out | 2 ++ tests/generic/group | 1 + 3 files changed, 81 insertions(+) create mode 100755 tests/generic/080 create mode 100644 tests/generic/080.out diff --git a/tests/generic/080 b/tests/generic/080 new file mode 100755 index 0000000..43c93d7 --- /dev/null +++ b/tests/generic/080 @@ -0,0 +1,78 @@ +#! /bin/bash +# FS QA Test No. 080 +# +# Verify that mtime is updated when writing to mmap-ed pages +# +#----------------------------------------------------------------------- +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=0 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* + rm -f $testfile +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs generic +_supported_os IRIX Linux +_require_test + +echo "Silence is golden." +rm -f $seqres.full + +# pattern the file. +testfile=$TEST_DIR/mmap_mtime_testfile +$XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $testfile >> $seqres.full + +# sample timestamps. +mtime1=`stat -c %Y $testfile` +ctime1=`stat -c %Z $testfile` +echo "before mwrite: $mtime1 $ctime1" >> $seqres.full + +# map read followed by map write to trigger timestamp change +sleep 2 +$XFS_IO_PROG -c "mmap 0 4k" -c "mread 0 4k" -c "mwrite 0 4k" $testfile \ + >> $seqres.full + +# sample and verify that timestamps have changed. +mtime2=`stat -c %Y $testfile` +ctime2=`stat -c %Z $testfile` +echo "after mwrite : $mtime2 $ctime2" >> $seqres.full + +if [ "$mtime1" == "$mtime2" ]; then + echo "mtime not updated" + let status=$status+1 +fi +if [ "$ctime1" == "$ctime2" ]; then + echo "ctime not updated" + let status=$status+1 +fi + +exit diff --git a/tests/generic/080.out b/tests/generic/080.out new file mode 100644 index 0000000..cccac52 --- /dev/null +++ b/tests/generic/080.out @@ -0,0 +1,2 @@ +QA output created by 080 +Silence is golden. diff --git a/tests/generic/group b/tests/generic/group index d56d3ce..8154401 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -79,6 +79,7 @@ 077 acl attr auto enospc 078 auto quick metadata 079 acl attr ioctl metadata auto quick +080 auto quick 083 rw auto enospc stress 088 perms auto quick 089 metadata auto -- 1.9.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3] xfstest: generic/080 test that mmap-write updates c/mtime 2015-03-19 15:30 ` Eryu Guan 2015-03-19 15:58 ` [PATCH v4] " Boaz Harrosh @ 2015-03-19 16:02 ` Boaz Harrosh 1 sibling, 0 replies; 8+ messages in thread From: Boaz Harrosh @ 2015-03-19 16:02 UTC (permalink / raw) To: Eryu Guan; +Cc: Dave Chinner, Matthew Wilcox, linux-fsdevel, fstests On 03/19/2015 05:30 PM, Eryu Guan wrote: <> > > I tested it with xfs/ext4/btrfs/nfs and cifs, cifs failed the test. > Ha there you go. I think git has some operation that do this and the date gets screwed. > The test looks good to me (with one nitpick below). > I have sent v4 that fixes this > Reviewed-by: Eryu Guan <eguan@redhat.com> > And also added this one. Thank you sir Eryu Boaz ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-03-19 16:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <54F733BD.7060807@plexistor.com>
[not found] ` <54F734C4.7080409@plexistor.com>
[not found] ` <20150305001312.GA4251@dastard>
[not found] ` <54F861F3.9000805@plexistor.com>
2015-03-05 14:12 ` [PATCH 1/3 v2] xfstest: generic/080 test that mmap-write updates c/mtime Boaz Harrosh
2015-03-19 9:53 ` [PATCH 1/3 v2 resend] " Boaz Harrosh
2015-03-19 10:44 ` Eryu Guan
2015-03-19 11:46 ` [PATCH v3] " Boaz Harrosh
2015-03-19 11:49 ` Boaz Harrosh
2015-03-19 15:30 ` Eryu Guan
2015-03-19 15:58 ` [PATCH v4] " Boaz Harrosh
2015-03-19 16:02 ` [PATCH v3] " Boaz Harrosh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox