diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2015-09-17 19:02:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-18 00:16:07 -0400 |
commit | 28c553d0aa0acf02e18f9e008661491a4b996595 (patch) | |
tree | 3a05cd1217251a7abe9164f6d6ebdeaeef66c16f | |
parent | 0526109a24eb07984f9e79852767300c8b8144de (diff) |
revert "mm: make sure all file VMAs have ->vm_ops set"
Revert commit 6dc296e7df4c "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: William Shuman <wshuman3@gmail.com>
Reported-by: Will Deacon <will.deacon@arm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/mmap.c | 8 |
1 files changed, 0 insertions, 8 deletions
@@ -612,8 +612,6 @@ static unsigned long count_vma_pages_range(struct mm_struct *mm, | |||
612 | void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, | 612 | void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, |
613 | struct rb_node **rb_link, struct rb_node *rb_parent) | 613 | struct rb_node **rb_link, struct rb_node *rb_parent) |
614 | { | 614 | { |
615 | WARN_ONCE(vma->vm_file && !vma->vm_ops, "missing vma->vm_ops"); | ||
616 | |||
617 | /* Update tracking information for the gap following the new vma. */ | 615 | /* Update tracking information for the gap following the new vma. */ |
618 | if (vma->vm_next) | 616 | if (vma->vm_next) |
619 | vma_gap_update(vma->vm_next); | 617 | vma_gap_update(vma->vm_next); |
@@ -1638,12 +1636,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr, | |||
1638 | */ | 1636 | */ |
1639 | WARN_ON_ONCE(addr != vma->vm_start); | 1637 | WARN_ON_ONCE(addr != vma->vm_start); |
1640 | 1638 | ||
1641 | /* All file mapping must have ->vm_ops set */ | ||
1642 | if (!vma->vm_ops) { | ||
1643 | static const struct vm_operations_struct dummy_ops = {}; | ||
1644 | vma->vm_ops = &dummy_ops; | ||
1645 | } | ||
1646 | |||
1647 | addr = vma->vm_start; | 1639 | addr = vma->vm_start; |
1648 | vm_flags = vma->vm_flags; | 1640 | vm_flags = vma->vm_flags; |
1649 | } else if (vm_flags & VM_SHARED) { | 1641 | } else if (vm_flags & VM_SHARED) { |