The patch titled Subject: mm-mmap-vma_merge-set-mid-to-null-if-not-applicable-fix has been added to the -mm mm-unstable branch. Its filename is mm-mmap-vma_merge-set-mid-to-null-if-not-applicable-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-mmap-vma_merge-set-mid-to-null-if-not-applicable-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 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/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Vlastimil Babka <vbabka@xxxxxxx> Subject: mm-mmap-vma_merge-set-mid-to-null-if-not-applicable-fix adjust/add comments as suggested by Lorenzo Link: https://lkml.kernel.org/r/def43190-53f7-a607-d1b0-b657565f4288@xxxxxxx Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx> Cc: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx> Cc: Lorenzo Stoakes <lstoakes@xxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/mm/mmap.c~mm-mmap-vma_merge-set-mid-to-null-if-not-applicable-fix +++ a/mm/mmap.c @@ -861,8 +861,9 @@ can_vma_merge_after(struct vm_area_struc * * The following mprotect cases have to be considered, where AAAA is * the area passed down from mprotect_fixup, never extending beyond one - * vma, PPPPPP is the prev vma specified, NNNN is a vma that overlaps - * the area AAAA and XXXXXX the next vma after AAAA: + * vma, PPPP is the previous vma, NNNN is a vma that starts at the same + * address as AAAA and is of the same or larger span, and XXXX the next + * vma after AAAA: * * AAAA AAAA AAAA * PPPPPPXXXXXX PPPPPPXXXXXX PPPPPPNNNNNN @@ -933,6 +934,7 @@ struct vm_area_struct *vma_merge(struct else next = mid; + /* In cases 1 - 4 there's no NNNN vma */ if (mid && end <= mid->vm_start) mid = NULL; _ Patches currently in -mm which might be from vbabka@xxxxxxx are mm-page_alloc-reduce-page-alloc-free-sanity-checks.patch mm-mmap-vma_merge-use-only-primary-pointers-for-preparing-merge.patch mm-mmap-vma_merge-use-the-proper-vma-pointer-in-case-3.patch mm-mmap-vma_merge-use-the-proper-vma-pointers-in-cases-1-and-6.patch mm-mmap-vma_merge-use-the-proper-vma-pointer-in-case-4.patch mm-mmap-vma_merge-initialize-mid-and-next-in-natural-order.patch mm-mmap-vma_merge-set-mid-to-null-if-not-applicable.patch mm-mmap-vma_merge-set-mid-to-null-if-not-applicable-fix.patch mm-mmap-vma_merge-rename-adj_next-to-adj_start.patch mm-mmap-vma_merge-convert-mergeability-checks-to-return-bool.patch mm-mmap-start-distinguishing-if-vma-can-be-removed-in-mergeability-test.patch mm-mmap-start-distinguishing-if-vma-can-be-removed-in-mergeability-test-fix.patch mm-mremap-simplify-vma-expansion-again.patch