diff options
author | Hugh Dickins <hugh@veritas.com> | 2005-11-29 11:55:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-29 17:09:17 -0500 |
commit | 325f04dbca60a4cfe4ac25e7cf246edd07eb4c5f (patch) | |
tree | eb9e9fb10b1897fae3130c55c4821b829748767b /mm/memory.c | |
parent | e5bbe4dfc8dbfc50ef89f8641e020616d4d1e69e (diff) |
[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>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c index ae259b6e5a21..5bfa52a98630 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2009,6 +2009,8 @@ static int do_no_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2009 | int anon = 0; | 2009 | int anon = 0; |
2010 | 2010 | ||
2011 | pte_unmap(page_table); | 2011 | pte_unmap(page_table); |
2012 | BUG_ON(vma->vm_flags & VM_PFNMAP); | ||
2013 | |||
2012 | if (vma->vm_file) { | 2014 | if (vma->vm_file) { |
2013 | mapping = vma->vm_file->f_mapping; | 2015 | mapping = vma->vm_file->f_mapping; |
2014 | sequence = mapping->truncate_count; | 2016 | sequence = mapping->truncate_count; |
@@ -2041,7 +2043,7 @@ retry: | |||
2041 | page = alloc_page_vma(GFP_HIGHUSER, vma, address); | 2043 | page = alloc_page_vma(GFP_HIGHUSER, vma, address); |
2042 | if (!page) | 2044 | if (!page) |
2043 | goto oom; | 2045 | goto oom; |
2044 | cow_user_page(page, new_page, address); | 2046 | copy_user_highpage(page, new_page, address); |
2045 | page_cache_release(new_page); | 2047 | page_cache_release(new_page); |
2046 | new_page = page; | 2048 | new_page = page; |
2047 | anon = 1; | 2049 | anon = 1; |