Skip to content

Commit

Permalink
[PATCH] pfnmap: do_no_page BUG_ON again
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Nov 29, 2005
1 parent e5bbe4d commit 325f04d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,8 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
int anon = 0;

pte_unmap(page_table);
BUG_ON(vma->vm_flags & VM_PFNMAP);

if (vma->vm_file) {
mapping = vma->vm_file->f_mapping;
sequence = mapping->truncate_count;
Expand Down Expand Up @@ -2041,7 +2043,7 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
page = alloc_page_vma(GFP_HIGHUSER, vma, address);
if (!page)
goto oom;
cow_user_page(page, new_page, address);
copy_user_highpage(page, new_page, address);
page_cache_release(new_page);
new_page = page;
anon = 1;
Expand Down

0 comments on commit 325f04d

Please sign in to comment.