From 5ff9438fe11a81c9374e163d0be895acddc58685 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Thu, 18 May 2023 10:55:31 -0400 Subject: [PATCH] FROMGIT: BACKPORT: mm/mmap: change do_vmi_align_munmap() for maple tree iterator changes The maple tree iterator clean up is incompatible with the way do_vmi_align_munmap() expects it to behave. Update the expected behaviour to map now since the change will work currently. Link: https://lkml.kernel.org/r/20230518145544.1722059-23-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton (cherry picked from commit a4d5b9fbaf42d668c1b5c7f231f79776a9419a91 git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-unstable) [surenb: adjust for missing vma_iter_load] Bug: 274059236 Change-Id: Id05ab617a3539f885a32c7d3031098a8c005fff8 Signed-off-by: Suren Baghdasaryan --- mm/mmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index 5ff6be2faac4..91e5f2aacca5 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2394,6 +2394,8 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma, #endif } + if (mas->last >= end) + next = mas_walk(mas); if (!next) next = mas_next(mas, ULONG_MAX);