Commit 46435364 authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

mm: retire GUP WARN_ON_ONCE that outlived its usefulness

Trinity is now hitting the WARN_ON_ONCE we added in v3.15 commit
cda540ac ("mm: get_user_pages(write,force) refuse to COW in shared
areas").  The warning has served its purpose, nobody was harmed by that
change, so just remove the warning to generate less noise from Trinity.

Which reminds me of the comment I wrongly left behind with that commit
(but was spotted at the time by Kirill), which has since moved into a
separate function, and become even more obscure: delete it.
Reported-by: default avatarDave Jones <davej@codemonkey.org.uk>
Suggested-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: default avatarHugh Dickins <hughd@google.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 34229b27
...@@ -430,10 +430,8 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags) ...@@ -430,10 +430,8 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags)
* Anon pages in shared mappings are surprising: now * Anon pages in shared mappings are surprising: now
* just reject it. * just reject it.
*/ */
if (!is_cow_mapping(vm_flags)) { if (!is_cow_mapping(vm_flags))
WARN_ON_ONCE(vm_flags & VM_MAYWRITE);
return -EFAULT; return -EFAULT;
}
} }
} else if (!(vm_flags & VM_READ)) { } else if (!(vm_flags & VM_READ)) {
if (!(gup_flags & FOLL_FORCE)) if (!(gup_flags & FOLL_FORCE))
......
...@@ -2237,11 +2237,6 @@ static int wp_page_shared(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -2237,11 +2237,6 @@ static int wp_page_shared(struct mm_struct *mm, struct vm_area_struct *vma,
page_cache_get(old_page); page_cache_get(old_page);
/*
* Only catch write-faults on shared writable pages,
* read-only shared pages can get COWed by
* get_user_pages(.write=1, .force=1).
*/
if (vma->vm_ops && vma->vm_ops->page_mkwrite) { if (vma->vm_ops && vma->vm_ops->page_mkwrite) {
int tmp; int tmp;
......
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