|
@@ -336,14 +336,13 @@ vma_address(struct page *page, struct vm_area_struct *vma)
|
|
|
|
|
|
/*
|
|
/*
|
|
* At what user virtual address is page expected in vma?
|
|
* At what user virtual address is page expected in vma?
|
|
- * checking that the page matches the vma.
|
|
|
|
|
|
+ * Caller should check the page is actually part of the 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 (vma->anon_vma != page_anon_vma(page))
|
|
|
|
- return -EFAULT;
|
|
|
|
- } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) {
|
|
|
|
|
|
+ if (PageAnon(page))
|
|
|
|
+ ;
|
|
|
|
+ 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;
|