Re: [PATCH v8 14/21] mm/mmap: Avoid zeroing vma tree in mmap_region()

Lorenzo Stoakes
2024-10-03T09:04:43Z

On Thu, Oct 03, 2024 at 10:59:12AM +0200, Bert Karwatzki wrote:
> Here's the latest log.
>
> Top three commits:
> db8adf7c0a23 (HEAD -> maple_tree_debug) hack: mm: see if we can get some more information 2
> 7e3bb072761a mm: correct error handling in mmap_region()
> 77df9e4bb222 (tag: next-20241001, origin/master, origin/HEAD, master) Add linux-next specific files for 20241001
>
> Bert Karwatzki
>

[snip]

Thanks!

Could you try this patch and see if you can repro the same bug?

----8<----
From 291eb64273dbafa4823a2b21bdae714ea1f021ac Mon Sep 17 00:00:00 2001
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Date: Thu, 3 Oct 2024 10:02:04 +0100
Subject: [PATCH] maybe fix

---
mm/vma.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/vma.c b/mm/vma.c
index 6abeef9bc2c8..38f69c656825 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -598,13 +598,13 @@ static int commit_merge(struct vma_merge_struct *vmg,
adjust->vm_end);
}

- if (vma_iter_prealloc(vmg->vmi, vmg->vma))
- return -ENOMEM;
-
vma_prepare(&vp);
vma_adjust_trans_huge(vmg->vma, vmg->start, vmg->end, adj_start);
vma_set_range(vmg->vma, vmg->start, vmg->end, vmg->pgoff);

+ if (vma_iter_prealloc(vmg->vmi, vmg->vma))
+ return -ENOMEM;
+
if (expanded)
vma_iter_store(vmg->vmi, vmg->vma);

--
2.46.2