Commit 21d0d443 authored by Andrea Arcangeli's avatar Andrea Arcangeli Committed by Linus Torvalds

rmap: resurrect page_address_in_vma anon_vma check

With root anon-vma it's trivial to keep doing the usual check as in
old-anon-vma code.
Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
Signed-off-by: default avatarRik van Riel <riel@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 288468c3
...@@ -364,9 +364,10 @@ vma_address(struct page *page, struct vm_area_struct *vma) ...@@ -364,9 +364,10 @@ vma_address(struct page *page, struct vm_area_struct *vma)
*/ */
unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma)
{ {
if (PageAnon(page)) if (PageAnon(page)) {
; if (vma->anon_vma->root != page_anon_vma(page)->root)
else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { return -EFAULT;
} else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) {
if (!vma->vm_file || if (!vma->vm_file ||
vma->vm_file->f_mapping != page->mapping) vma->vm_file->f_mapping != page->mapping)
return -EFAULT; return -EFAULT;
......
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