Re: [RFC PATCH] mm/hugetlb: fix resv_map memory leak in __mmap_region error path

From: David Hildenbrand (Arm)

Date: Mon Apr 27 2026 - 04:18:41 EST



>> /*
>> * We cannot permit the rmap finding this VMA in the time
>> * between the VMA being inserted into the VMA tree and the
>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>> index a308e2c23b82..9320f6699fa9 100644
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -861,6 +861,8 @@ struct mmap_action {
>> * it is not valid to clear the error here.
>> */
>> int (*error_hook)(int err);
>> +
>> + void (*abort_hook)(struct vm_area_desc *desc);
>
> At least for me, it is not good name to distinguish it from error_hook.
> abort_mmap_prepare? I am not sure if it is a good solution, Cc other
> MM maintainers as well.
>

I'm sure Lorenzo will provide feedback here :)

--
Cheers,

David