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: 7104551 Return-Path: X-Original-To: patchwork-linux-fsdevel@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 629CD9F32B for ; Tue, 1 Sep 2015 10:23:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99C7D20591 for ; Tue, 1 Sep 2015 10:23:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B609B2058E for ; Tue, 1 Sep 2015 10:23:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755297AbbIAKWv (ORCPT ); Tue, 1 Sep 2015 06:22:51 -0400 Received: from mga09.intel.com ([134.134.136.24]:38745 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755272AbbIAKWu (ORCPT ); Tue, 1 Sep 2015 06:22:50 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 01 Sep 2015 03:22:51 -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 Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, "Kirill A. Shutemov" , Yigal Korman , Boaz Harrosh , Jan Kara , Dave Chinner 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 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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