From: Liam R. Howlett Date: Fri, 28 Feb 2020 20:19:07 +0000 (-0500) Subject: mm/mmap: Maple tree update for validate_mm_mt and comments X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2c6c577631e1d1bcaf63ddf8cf2d8526f1e8b613;p=users%2Fjedix%2Flinux-maple.git mm/mmap: Maple tree update for validate_mm_mt and comments Signed-off-by: Liam R. Howlett --- diff --git a/mm/mmap.c b/mm/mmap.c index 8bf8ee55ae295..c895182c9c02c 100644 --- 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); }