From patchwork Tue Sep 1 10:22:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 7104531 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 47D4F9F32B for ; Tue, 1 Sep 2015 10:22:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 683C92058E for ; Tue, 1 Sep 2015 10:22:52 +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 885E02058A for ; Tue, 1 Sep 2015 10:22:51 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 50E6D182E62; Tue, 1 Sep 2015 03:22:51 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ml01.01.org (Postfix) with ESMTP id 9DF1F182DF4 for ; Tue, 1 Sep 2015 03:22:50 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 01 Sep 2015 03:22:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,448,1437462000"; d="scan'208";a="795350302" Received: from black.fi.intel.com ([10.237.72.157]) by orsmga002.jf.intel.com with ESMTP; 01 Sep 2015 03:22:47 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 6E6AB26B; Tue, 1 Sep 2015 13:22:46 +0300 (EEST) From: "Kirill A. Shutemov" To: Andrew Morton , Matthew Wilcox Subject: [PATCH] mm, dax: VMA with vm_ops->pfn_mkwrite wants to be write-notified Date: Tue, 1 Sep 2015 13:22:41 +0300 Message-Id: <1441102961-68041-1-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.5.0 Cc: Jan Kara , linux-nvdimm@lists.01.org, Dave Chinner , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, "Kirill A. Shutemov" X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 For VM_PFNMAP and VM_MIXEDMAP we use vm_ops->pfn_mkwrite instead of vm_ops->page_mkwrite to notify abort write access. This means we want vma->vm_page_prot to be write-protected if the VMA provides this vm_ops. Signed-off-by: Kirill A. Shutemov Cc: Yigal Korman Cc: Boaz Harrosh Cc: Matthew Wilcox Cc: Jan Kara Cc: Dave Chinner --- mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index df6d5f07035b..3f78bceefe5a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1498,7 +1498,8 @@ int vma_wants_writenotify(struct vm_area_struct *vma) return 0; /* The backer wishes to know when pages are first written to? */ - if (vma->vm_ops && vma->vm_ops->page_mkwrite) + if (vma->vm_ops && + (vma->vm_ops->page_mkwrite || vma->vm_ops->pfn_mkwrite)) return 1; /* The open routine did something to the protections that pgprot_modify