From: "=?UTF-8?Q?Jan_H._Sch=c3=b6nherr?=" Subject: Re: [PATCH] dax: Release PMD lock even when there is no PMD support in DAX Date: Thu, 18 Jan 2018 15:22:58 +0100 Message-ID: <5c50be9f-0ade-41ae-e137-0171ed1ef924@amazon.de> References: <20180118133839.20587-1-jschoenh@amazon.de> <20180118140739.GA28322@bombadil.infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Matthew Wilcox , Ross Zwisler , linux-fsdevel@vger.kernel.org To: Matthew Wilcox Return-path: Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:53566 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756374AbeAROXN (ORCPT ); Thu, 18 Jan 2018 09:23:13 -0500 In-Reply-To: <20180118140739.GA28322@bombadil.infradead.org> Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 01/18/2018 03:07 PM, Matthew Wilcox wrote: > On Thu, Jan 18, 2018 at 02:38:39PM +0100, Jan H. Schönherr wrote: >> The function follow_pte_pmd() can theoretically return after having >> acquired a PMD lock, even when DAX was not compiled with >> CONFIG_FS_DAX_PMD. > > I don't think it can. How would a PMD entry get into a DAX VMA if we > compiled the kernel without CONFIG_FS_DAX_PMD? > Maybe it can not in happy cases. But the PMD parts in follow_pte_pmd() are compiled in unconditionally. So, if there's an issue elsewhere, and for some weird reason we get a PMD entry in the page table, it would screw the lock balance. I haven't run into an actual issue with this, it's just supposed to be defensive. Regards Jan