]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mmap: Change do_vmi_align_munmap() for maple tree iterator changes
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 5 Apr 2023 15:43:07 +0000 (11:43 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 6 Apr 2023 13:18:09 +0000 (09:18 -0400)
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 <Liam.Howlett@oracle.com>
mm/mmap.c

index bae6edc2441a58b163380b348523e13df99dcb53..4191ed8ee5fe9d9edb989d7389c051f264ed9c21 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2345,7 +2345,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