Commit 315ab19a authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] mm: restore vm_normal_page check

Hugh is rightly concerned that the CONFIG_DEBUG_VM coverage has gone too
far in vm_normal_page, considering that we expect production kernels to be
shipped with the option turned off, and that the code has been under some
large changes recently.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f081a529
...@@ -395,12 +395,16 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_ ...@@ -395,12 +395,16 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_
return NULL; return NULL;
} }
#ifdef CONFIG_DEBUG_VM /*
* Add some anal sanity checks for now. Eventually,
* we should just do "return pfn_to_page(pfn)", but
* in the meantime we check that we get a valid pfn,
* and that the resulting page looks ok.
*/
if (unlikely(!pfn_valid(pfn))) { if (unlikely(!pfn_valid(pfn))) {
print_bad_pte(vma, pte, addr); print_bad_pte(vma, pte, addr);
return NULL; return NULL;
} }
#endif
/* /*
* NOTE! We still have PageReserved() pages in the page * NOTE! We still have PageReserved() pages in the page
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment