The patch titled Subject: mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region has been added to the -mm tree. Its filename is mm-mmapc-remove-incorrect-map_fixed-flag-comparison-from-mmap_region.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-mmapc-remove-incorrect-map_fixed-flag-comparison-from-mmap_region.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-mmapc-remove-incorrect-map_fixed-flag-comparison-from-mmap_region.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Piotr Kwapulinski <kwapulinski.piotr@xxxxxxxxx> Subject: mm/mmap.c: remove incorrect MAP_FIXED flag comparison from mmap_region The following flag comparison in mmap_region is not fully correct: if (!(vm_flags & MAP_FIXED)) The vm_flags should not be compared with MAP_FIXED (0x10). It is a bit confusing. This condition is almost always true since VM_MAYREAD (0x10) flag is almost always set by default. This patch removes this condition. Signed-off-by: Piotr Kwapulinski <kwapulinski.piotr@xxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Chris Metcalf <cmetcalf@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mmap.c | 7 ------- 1 file changed, 7 deletions(-) diff -puN mm/mmap.c~mm-mmapc-remove-incorrect-map_fixed-flag-comparison-from-mmap_region mm/mmap.c --- a/mm/mmap.c~mm-mmapc-remove-incorrect-map_fixed-flag-comparison-from-mmap_region +++ a/mm/mmap.c @@ -1547,13 +1547,6 @@ unsigned long mmap_region(struct file *f if (!may_expand_vm(mm, len >> PAGE_SHIFT)) { unsigned long nr_pages; - /* - * MAP_FIXED may remove pages of mappings that intersects with - * requested mapping. Account for the pages it would unmap. - */ - if (!(vm_flags & MAP_FIXED)) - return -ENOMEM; - nr_pages = count_vma_pages_range(mm, addr, addr + len); if (!may_expand_vm(mm, (len >> PAGE_SHIFT) - nr_pages)) _ Patches currently in -mm which might be from kwapulinski.piotr@xxxxxxxxx are mm-mmapc-remove-incorrect-map_fixed-flag-comparison-from-mmap_region.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html