[PATCH] pfnmap: do_no_page BUG_ON again

Use copy_user_highpage directly instead of cow_user_page in do_no_page:
in the immediately following page_cache_release, and elsewhere, it is
assuming that new_page is normal. If any VM_PFNMAP driver can get to
do_no_page, it's just a BUG (but not in the case of do_anonymous_page).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Hugh Dickins and committed by Linus Torvalds 325f04db e5bbe4df

+3 -1
+3 -1
mm/memory.c
··· 2009 2009 int anon = 0; 2010 2010 2011 2011 pte_unmap(page_table); 2012 + BUG_ON(vma->vm_flags & VM_PFNMAP); 2013 + 2012 2014 if (vma->vm_file) { 2013 2015 mapping = vma->vm_file->f_mapping; 2014 2016 sequence = mapping->truncate_count; ··· 2043 2041 page = alloc_page_vma(GFP_HIGHUSER, vma, address); 2044 2042 if (!page) 2045 2043 goto oom; 2046 - cow_user_page(page, new_page, address); 2044 + copy_user_highpage(page, new_page, address); 2047 2045 page_cache_release(new_page); 2048 2046 new_page = page; 2049 2047 anon = 1;