aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c11
-rw-r--r--mm/swapfile.c7
2 files changed, 11 insertions, 7 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 890095f5f36d..b273cc12b15d 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -810,8 +810,12 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
810 */ 810 */
811 if (unlikely(details)) 811 if (unlikely(details))
812 continue; 812 continue;
813 if (!pte_file(ptent)) 813 if (pte_file(ptent)) {
814 free_swap_and_cache(pte_to_swp_entry(ptent)); 814 if (unlikely(!(vma->vm_flags & VM_NONLINEAR)))
815 print_bad_pte(vma, addr, ptent, NULL);
816 } else if
817 (unlikely(!free_swap_and_cache(pte_to_swp_entry(ptent))))
818 print_bad_pte(vma, addr, ptent, NULL);
815 pte_clear_not_present_full(mm, addr, pte, tlb->fullmm); 819 pte_clear_not_present_full(mm, addr, pte, tlb->fullmm);
816 } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0)); 820 } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0));
817 821
@@ -2707,8 +2711,7 @@ static int do_nonlinear_fault(struct mm_struct *mm, struct vm_area_struct *vma,
2707 if (!pte_unmap_same(mm, pmd, page_table, orig_pte)) 2711 if (!pte_unmap_same(mm, pmd, page_table, orig_pte))
2708 return 0; 2712 return 0;
2709 2713
2710 if (unlikely(!(vma->vm_flags & VM_NONLINEAR) || 2714 if (unlikely(!(vma->vm_flags & VM_NONLINEAR))) {
2711 !(vma->vm_flags & VM_CAN_NONLINEAR))) {
2712 /* 2715 /*
2713 * Page table corrupted: show pte and kill process. 2716 * Page table corrupted: show pte and kill process.
2714 */ 2717 */
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d00523601913..f28745855772 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -571,13 +571,13 @@ int try_to_free_swap(struct page *page)
571 * Free the swap entry like above, but also try to 571 * Free the swap entry like above, but also try to
572 * free the page cache entry if it is the last user. 572 * free the page cache entry if it is the last user.
573 */ 573 */
574void free_swap_and_cache(swp_entry_t entry) 574int free_swap_and_cache(swp_entry_t entry)
575{ 575{
576 struct swap_info_struct * p; 576 struct swap_info_struct *p;
577 struct page *page = NULL; 577 struct page *page = NULL;
578 578
579 if (is_migration_entry(entry)) 579 if (is_migration_entry(entry))
580 return; 580 return 1;
581 581
582 p = swap_info_get(entry); 582 p = swap_info_get(entry);
583 if (p) { 583 if (p) {
@@ -603,6 +603,7 @@ void free_swap_and_cache(swp_entry_t entry)
603 unlock_page(page); 603 unlock_page(page);
604 page_cache_release(page); 604 page_cache_release(page);
605 } 605 }
606 return p != NULL;
606} 607}
607 608
608#ifdef CONFIG_HIBERNATION 609#ifdef CONFIG_HIBERNATION