]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mmap: Maple tree update for validate_mm_mt and comments
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 28 Feb 2020 20:19:07 +0000 (15:19 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:02:53 +0000 (15:02 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index 8bf8ee55ae295c3aaef4f05e11e1e9679fe5d5e9..c895182c9c02c3a0a5d13e0d00cdee292cd1774b 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -422,10 +422,14 @@ static void validate_mm_mt(struct mm_struct *mm,
 
                if ((vma != vma_mt) ||
                    (vma->vm_start != vma_mt->vm_start) ||
-                   (vma->vm_end != vma_mt->vm_end)) {
-                       pr_emerg("mt: %px %lu - %lu\n", vma_mt,
+                   (vma->vm_end != vma_mt->vm_end) ||
+                   (vma->vm_start != mas.index) ||
+                   (vma->vm_end -1 != mas.last)){
+                       pr_emerg("mt piv: %px %lu - %lu\n", vma_mt,
+                                mas.index, mas.last);
+                       pr_emerg("mt vma: %px %lu - %lu\n", vma_mt,
                                 vma_mt->vm_start, vma_mt->vm_end);
-                       pr_emerg("rb: %px %lu - %lu\n", vma,
+                       pr_emerg("rb vma: %px %lu - %lu\n", vma,
                                 vma->vm_start, vma->vm_end);
                        if (ignore)
                                pr_emerg("rb_skip %px %lu - %lu\n", ignore,
@@ -1058,8 +1062,12 @@ again:
 
        vma->vm_pgoff = pgoff;
        if (adjust_next) {
+               // maple tree erase is unnecessary as the adjusting of the vma
+               // would have overwritten the area.
                next->vm_start += adjust_next;
                next->vm_pgoff += adjust_next >> PAGE_SHIFT;
+               // the vma_store is necessary as the adjust_next may be
+               // negative and expand backwards.
                __vma_mt_store(mm, next);
        }