From patchwork Thu Mar 5 14:02:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 5946261 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 51394BF440 for ; Thu, 5 Mar 2015 14:02:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85D652038C for ; Thu, 5 Mar 2015 14:02:37 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A050C20173 for ; Thu, 5 Mar 2015 14:02:33 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4BE7F80DF6; Thu, 5 Mar 2015 06:02:33 -0800 (PST) X-Original-To: linux-nvdimm@ml01.01.org Delivered-To: linux-nvdimm@ml01.01.org Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A16FD80DF6 for ; Thu, 5 Mar 2015 06:02:32 -0800 (PST) Received: by wggz12 with SMTP id z12so16447092wgg.9 for ; Thu, 05 Mar 2015 06:02:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=1H4AwXfKArt5ZjTqkmv39YTRVdmJh34ycuqhV3dKGOU=; b=ShaL0DUTJgGmRCAL1S1RcA64qITyl6AwLP/xtcwh9G9ReDe+aHVj+IXYE3P5ooDNnQ QbCwaevLJ1yHp6p8AyLmds36l5bG8LUFTQ1yb54QFfFzPX9uu4Vf6atxbo7GnvMiwOcg w+o4XYqD+5Rf0E+msB7CEt9lEeC/ZCGu9BGFmwBSAVVTWzmT4EtTcO0mjqQByisQhVdd KBR/hhNwyOLuPBiW4EvBFzKdlIfALua/dygPDO8jdHoibcrnBLSNAADlT+Ht3c6q0cRW +AOU9Z5L7BQyBebfF+9sJ06gzzQ0w+3+MzjTyxufx/j2ozCSw/7Pw6yz3op0x6O617Hd GL8A== X-Gm-Message-State: ALoCoQloXRwztT/2AseoOx3dfNyHTh+AzIttLZMpzTF7MFoRpxbEzZ7SMRvEACy9cXZGk6boloAA X-Received: by 10.180.76.178 with SMTP id l18mr22618817wiw.36.1425564150056; Thu, 05 Mar 2015 06:02:30 -0800 (PST) Received: from [10.0.0.5] ([207.232.55.62]) by mx.google.com with ESMTPSA id cn10sm10612393wib.15.2015.03.05.06.02.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 06:02:29 -0800 (PST) Message-ID: <54F861F3.9000805@plexistor.com> Date: Thu, 05 Mar 2015 16:02:27 +0200 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Dave Chinner , Boaz Harrosh References: <54F733BD.7060807@plexistor.com> <54F734C4.7080409@plexistor.com> <20150305001312.GA4251@dastard> In-Reply-To: <20150305001312.GA4251@dastard> Cc: Jan Kara , linux-nvdimm , Hugh Dickins , linux-mm@kvack.org, Matthew Wilcox , linux-fsdevel , Andrew Morton , "Kirill A. Shutemov" , Mel Gorman Subject: [Linux-nvdimm] [PATCH 1/3 v2] xfstest: generic/080 test that mmap-write updates c/mtime X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dave Chinner 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 Signed-off-by: Omer Zilberberg Signed-off-by: Boaz Harrosh --- 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