From 0a6dbcc507586e43a2d8795de6f9ee9a4943206a Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 30 Jan 2009 11:37:22 -0800 Subject: [PATCH] --- yaml --- r: 130531 b: refs/heads/master c: 33bfad54b58cf05cfe6678c3ec9235d4bc8db4c2 h: refs/heads/master i: 130529: dab2817709b5b6ca7f2ab2d95a68d9114e923abf 130527: 675d6ec908eec3a62201fce378741d2067dc4a6d v: v3 --- [refs] | 2 +- trunk/mm/mmap.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 2c5c1a753dd0..e22330d27b5f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c01a25e7cf6dcb0fa69c155706d5dd1e76e53796 +refs/heads/master: 33bfad54b58cf05cfe6678c3ec9235d4bc8db4c2 diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index d3fa10a726cf..c581df14d0de 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -658,6 +658,9 @@ again: remove_next = 1 + (end > next->vm_end); validate_mm(mm); } +/* Flags that can be inherited from an existing mapping when merging */ +#define VM_MERGEABLE_FLAGS (VM_CAN_NONLINEAR) + /* * If the vma has a ->close operation then the driver probably needs to release * per-vma resources, so we don't attempt to merge those. @@ -665,7 +668,7 @@ again: remove_next = 1 + (end > next->vm_end); static inline int is_mergeable_vma(struct vm_area_struct *vma, struct file *file, unsigned long vm_flags) { - if (vma->vm_flags != vm_flags) + if ((vma->vm_flags ^ vm_flags) & ~VM_MERGEABLE_FLAGS) return 0; if (vma->vm_file != file) return 0;