Skip to contentSkip to conversation

fs/dax.c: release PMD lock even when there is no PMD support in DAX

PATCH In review [email protected] 1 participant 1 message Feb 1, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/119 fs/dax.c: release PMD lock even when there is no PMD support in DAX

From: Jan H. Schönherr <[email protected]>
Subject: fs/dax.c: release PMD lock even when there is no PMD support in DAX

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")
Cc Matthew Wilcox <[email protected]>

---

 fs/dax.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dax.c renamed from fs/dax.c~dax-release-pmd-lock-even-when-there-is-no-pmd-support-in-dax +1 -1
diff -puN fs/dax.c~dax-release-pmd-lock-even-when-there-is-no-pmd-support-in-dax fs/dax.c
@@ -636,8 +636,8 @@ static void dax_mapping_entry_mkclean(st
 			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;

_