From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= Subject: [PATCH] dax: Release PMD lock even when there is no PMD support in DAX Date: Thu, 18 Jan 2018 14:38:39 +0100 Message-ID: <20180118133839.20587-1-jschoenh@amazon.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= , linux-fsdevel@vger.kernel.org To: Matthew Wilcox , Ross Zwisler Return-path: Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:58780 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755690AbeARNjC (ORCPT ); Thu, 18 Jan 2018 08:39:02 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. Release the PMD lock unconditionally. Fixes: f729c8c9b24f ("dax: wrprotect pmd_t in dax_mapping_entry_mkclean") Signed-off-by: Jan H. Schönherr --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 9598159..c2ebf10 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -636,8 +636,8 @@ static void dax_mapping_entry_mkclean(struct address_space *mapping, pmd = pmd_mkclean(pmd); set_pmd_at(vma->vm_mm, address, pmdp, pmd); unlock_pmd: - spin_unlock(ptl); #endif + spin_unlock(ptl); } else { if (pfn != pte_pfn(*ptep)) goto unlock_pte; -- 2.9.3.1.gcba166c.dirty