Commit 28c553d0 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

revert "mm: make sure all file VMAs have ->vm_ops set"

Revert commit 6dc296e7 "mm: make sure all file VMAs have ->vm_ops
set".

Will Deacon reports that it "causes some mmap regressions in LTP, which
appears to use a MAP_PRIVATE mmap of /dev/zero as a way to get anonymous
pages in some of its tests (specifically mmap10 [1])".

William Shuman reports Oracle crashes.

So revert the patch while we work out what to do.
Reported-by: default avatarWilliam Shuman <wshuman3@gmail.com>
Reported-by: default avatarWill Deacon <will.deacon@arm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0526109a
...@@ -612,8 +612,6 @@ static unsigned long count_vma_pages_range(struct mm_struct *mm, ...@@ -612,8 +612,6 @@ static unsigned long count_vma_pages_range(struct mm_struct *mm,
void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
struct rb_node **rb_link, struct rb_node *rb_parent) struct rb_node **rb_link, struct rb_node *rb_parent)
{ {
WARN_ONCE(vma->vm_file && !vma->vm_ops, "missing vma->vm_ops");
/* Update tracking information for the gap following the new vma. */ /* Update tracking information for the gap following the new vma. */
if (vma->vm_next) if (vma->vm_next)
vma_gap_update(vma->vm_next); vma_gap_update(vma->vm_next);
...@@ -1638,12 +1636,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr, ...@@ -1638,12 +1636,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
*/ */
WARN_ON_ONCE(addr != vma->vm_start); WARN_ON_ONCE(addr != vma->vm_start);
/* All file mapping must have ->vm_ops set */
if (!vma->vm_ops) {
static const struct vm_operations_struct dummy_ops = {};
vma->vm_ops = &dummy_ops;
}
addr = vma->vm_start; addr = vma->vm_start;
vm_flags = vma->vm_flags; vm_flags = vma->vm_flags;
} else if (vm_flags & VM_SHARED) { } else if (vm_flags & VM_SHARED) {
......
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