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

Bert Karwatzki
2024-10-05T08:58:11Z

> >
> > I just tested this and it passed ten tests (i.e. upgrading the proton version i
> > steam) in a row.
> >
> > Bert Karwatzki
>
> Perfect :) will send the fix upstream then as a hotfix for 6.12! Thanks
> very much for helping out with this, your help has been absolutely
> invaluable and HUGELY appreciated.
>
> Cheers, Lorenzo

I also tried another debugging patch:

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index e6f0da908ba7..35b0fe3e02f7 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -3773,6 +3773,8 @@ static noinline void mas_wr_spanning_store(struct
ma_wr_state *wr_mas)
/* Copy l_mas and store the value in b_node. */
mas_store_b_node(&l_wr_mas, &b_node, l_mas.end);
/* Copy r_mas into b_node. */
+ if (!r_populated && r_mas.offset <= r_mas.end)
+ printk(KERN_INFO "%s: avoiding maple tree corrution\n",
__func__);
if (r_populated && r_mas.offset <= r_mas.end)
mas_mab_cp(&r_mas, r_mas.offset, r_mas.end,
&b_node, b_node.b_end + 1);

and when running the test this prints

[ 293.477904] [ T5720] mas_wr_spanning_store: avoiding maple tree corrution
[ 293.480202] [ T5720] mas_wr_spanning_store: avoiding maple tree corrution
[ 293.482087] [ T5720] mas_wr_spanning_store: avoiding maple tree corrution
[ 293.484786] [ T5720] mas_wr_spanning_store: avoiding maple tree corrution
[ 293.486644] [ T5720] mas_wr_spanning_store: avoiding maple tree corrution

in dmesg.

Bert Karwatzki