From 6e12d66ec223863852fd753118ade4c26145f68d Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 5 Apr 2023 11:43:07 -0400 Subject: [PATCH] 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. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index d34a41791ddb..c0140a556870 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2391,7 +2391,11 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, #endif } - next = vma_next(vmi); + if (vma_iter_end(vmi) > end) + next = vma_iter_load(vmi); + else + next = vma_next(vmi); + if (unlikely(uf)) { /* * If userfaultfd_unmap_prep returns an error the vmas -- 2.50.1