From patchwork Fri Jan 29 21:53:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wilcox, Matthew R" X-Patchwork-Id: 8167741 Return-Path: X-Original-To: patchwork-linux-fsdevel@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 3D581BEEE5 for ; Fri, 29 Jan 2016 21:53:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E47B20374 for ; Fri, 29 Jan 2016 21:53:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E8782024F for ; Fri, 29 Jan 2016 21:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756944AbcA2Vxr (ORCPT ); Fri, 29 Jan 2016 16:53:47 -0500 Received: from mga01.intel.com ([192.55.52.88]:51320 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756907AbcA2Vxr convert rfc822-to-8bit (ORCPT ); Fri, 29 Jan 2016 16:53:47 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 29 Jan 2016 13:53:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,366,1449561600"; d="scan'208";a="736787800" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 29 Jan 2016 13:53:46 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 29 Jan 2016 13:53:45 -0800 Received: from fmsmsx114.amr.corp.intel.com ([169.254.6.239]) by FMSMSX119.amr.corp.intel.com ([169.254.14.118]) with mapi id 14.03.0248.002; Fri, 29 Jan 2016 13:53:45 -0800 From: "Wilcox, Matthew R" To: Jared Hulbert , "linux-fsdevel@vger.kernel.org" , "ross.zwisler@linux.intel.com" Subject: RE: bug in COW no page fault? Thread-Topic: bug in COW no page fault? Thread-Index: AQHRWt1g+2QUfz+9PEadzlsBweqOA58TCO6z Date: Fri, 29 Jan 2016 21:53:44 +0000 Message-ID: <100D68C7BA14664A8938383216E40DE04217F70D@FMSMSX114.amr.corp.intel.com> References: <56ABDBC7.5030703@gmail.com> In-Reply-To: <56ABDBC7.5030703@gmail.com> Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.19.9.41] MIME-Version: 1.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, 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 Because we need to hold the i_mmap_sem until the page is inserted into the page tables to avoid racing with truncate. Therefore it is unlocked by the MM code. Did you try this patch? It should have BUGged immediately that you hit this case. If not, you have insufficient CONFIG_DEBUG enabled. diff --git a/fs/dax.c b/fs/dax.c index a7f77e1..30f2abe 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -416,6 +416,7 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault error = -EIO; goto out; } + i_mmap_unlock_read(mapping); } return VM_FAULT_LOCKED; }