From 710b5124aac67c4a48d29e32c2d9525278db405b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20H=2E=20Sch=C3=B6nherr?= Date: Wed, 31 Jan 2018 16:14:04 -0800 Subject: [PATCH] fs/dax.c: release PMD lock even when there is no PMD support in DAX MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit [ Upstream commit ee190ca6516bc8257e3d36187ca6f0f71a9ec477 ] 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. Link: http://lkml.kernel.org/r/20180118133839.20587-1-jschoenh@amazon.de Fixes: f729c8c9b24f ("dax: wrprotect pmd_t in dax_mapping_entry_mkclean") Signed-off-by: Jan H. Schönherr Reviewed-by: Ross Zwisler Reviewed-by: Andrew Morton Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 191306cd8b6b..ddb4981ae32e 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -630,8 +630,8 @@ static void dax_mapping_entry_mkclean(struct address_space *mapping, set_pmd_at(vma->vm_mm, address, pmdp, pmd); mmu_notifier_invalidate_range(vma->vm_mm, start, end); unlock_pmd: - spin_unlock(ptl); #endif + spin_unlock(ptl); } else { if (pfn != pte_pfn(*ptep)) goto unlock_pte; -- 2.20.1