]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mmap/vma_merge: use the proper vma pointers in cases 1 and 6
authorVlastimil Babka <vbabka@suse.cz>
Thu, 9 Mar 2023 11:12:51 +0000 (12:12 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 5 Apr 2023 23:02:25 +0000 (16:02 -0700)
commita1515af440e353c6f7bc1c805383776b56e2fbd1
tree466e7fbafff353f346751bd138ffd513c8e8bdbb
parenta3a9e76f1e6420fc21ba4d7be5c7e22745b16e03
mm/mmap/vma_merge: use the proper vma pointers in cases 1 and 6

Case 1 is now shown in the comment as next vma being merged with prev, so
use 'next' instead of 'mid'.  In case 1 they both point to the same vma.

As a consequence, in case 6, the dup_anon_vma() is now tried first on
'next' and then on 'mid', before it was the opposite order.  This is not a
functional change, as those two vma's cannnot have a different anon_vma,
as that would have prevented the merging in the first place.

Link: https://lkml.kernel.org/r/20230309111258.24079-4-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mmap.c