mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 15:56:18 +07:00
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: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
288468c334
commit
21d0d443cd
@ -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)
|
||||
{
|
||||
if (PageAnon(page))
|
||||
;
|
||||
else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) {
|
||||
if (PageAnon(page)) {
|
||||
if (vma->anon_vma->root != page_anon_vma(page)->root)
|
||||
return -EFAULT;
|
||||
} else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) {
|
||||
if (!vma->vm_file ||
|
||||
vma->vm_file->f_mapping != page->mapping)
|
||||
return -EFAULT;
|
||||
|
Loading…
Reference in New Issue
Block a user