aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 30991f83d0bf..635451abc8f7 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1591,10 +1591,15 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
1591 * than insert_pfn). If a zero_pfn were inserted into a VM_MIXEDMAP 1591 * than insert_pfn). If a zero_pfn were inserted into a VM_MIXEDMAP
1592 * without pte special, it would there be refcounted as a normal page. 1592 * without pte special, it would there be refcounted as a normal page.
1593 */ 1593 */
1594 if (!HAVE_PTE_SPECIAL && pfn_t_valid(pfn)) { 1594 if (!HAVE_PTE_SPECIAL && !pfn_t_devmap(pfn) && pfn_t_valid(pfn)) {
1595 struct page *page; 1595 struct page *page;
1596 1596
1597 page = pfn_t_to_page(pfn); 1597 /*
1598 * At this point we are committed to insert_page()
1599 * regardless of whether the caller specified flags that
1600 * result in pfn_t_has_page() == false.
1601 */
1602 page = pfn_to_page(pfn_t_to_pfn(pfn));
1598 return insert_page(vma, addr, page, vma->vm_page_prot); 1603 return insert_page(vma, addr, page, vma->vm_page_prot);
1599 } 1604 }
1600 return insert_pfn(vma, addr, pfn, vma->vm_page_prot); 1605 return insert_pfn(vma, addr, pfn, vma->vm_page_prot);
@@ -2232,11 +2237,6 @@ static int wp_page_shared(struct mm_struct *mm, struct vm_area_struct *vma,
2232 2237
2233 page_cache_get(old_page); 2238 page_cache_get(old_page);
2234 2239
2235 /*
2236 * Only catch write-faults on shared writable pages,
2237 * read-only shared pages can get COWed by
2238 * get_user_pages(.write=1, .force=1).
2239 */
2240 if (vma->vm_ops && vma->vm_ops->page_mkwrite) { 2240 if (vma->vm_ops && vma->vm_ops->page_mkwrite) {
2241 int tmp; 2241 int tmp;
2242 2242