diff options
-rw-r--r-- | mm/memory.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c index 072139579d89..4ad2d293ddc2 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1537,10 +1537,15 @@ static vm_fault_t insert_pfn(struct vm_area_struct *vma, unsigned long addr, | |||
1537 | * in may not match the PFN we have mapped if the | 1537 | * in may not match the PFN we have mapped if the |
1538 | * mapped PFN is a writeable COW page. In the mkwrite | 1538 | * mapped PFN is a writeable COW page. In the mkwrite |
1539 | * case we are creating a writable PTE for a shared | 1539 | * case we are creating a writable PTE for a shared |
1540 | * mapping and we expect the PFNs to match. | 1540 | * mapping and we expect the PFNs to match. If they |
1541 | * don't match, we are likely racing with block | ||
1542 | * allocation and mapping invalidation so just skip the | ||
1543 | * update. | ||
1541 | */ | 1544 | */ |
1542 | if (WARN_ON_ONCE(pte_pfn(*pte) != pfn_t_to_pfn(pfn))) | 1545 | if (pte_pfn(*pte) != pfn_t_to_pfn(pfn)) { |
1546 | WARN_ON_ONCE(!is_zero_pfn(pte_pfn(*pte))); | ||
1543 | goto out_unlock; | 1547 | goto out_unlock; |
1548 | } | ||
1544 | entry = *pte; | 1549 | entry = *pte; |
1545 | goto out_mkwrite; | 1550 | goto out_mkwrite; |
1546 | } else | 1551 | } else |