]> git.baikalelectronics.ru Git - kernel.git/commit
nommu: fix split_vma() map_count error
authorLiam Howlett <liam.howlett@oracle.com>
Mon, 9 Jan 2023 20:58:20 +0000 (20:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:24:33 +0000 (07:24 +0100)
commitb4edfaf9489cc1a4bc75b6d27ef20ee1e18506ac
treeaf34947e1b9eac9488b9edc7d80af8a0f72d78ba
parent7b73781babc947027b2da9273cbdeda253e4a844
nommu: fix split_vma() map_count error

commit fd9edbdbdcde6b489ce59f326755ef16a2ffadd7 upstream.

During the maple tree conversion of nommu, an error in counting the VMAs
was introduced by counting the existing VMA again.  The counting used to
be decremented by one and incremented by two, but now it only increments
by two.  Fix the counting error by moving the increment outside the
setup_vma_to_mm() function to the callers.

Link: https://lkml.kernel.org/r/20230109205809.956325-1-Liam.Howlett@oracle.com
Fixes: a93179ddc10b ("nommu: remove uses of VMA linked list")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yu Zhao <yuzhao@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/nommu.c