Re: [PATCH] mm/vmalloc: Fix incorrect size reporting on allocation failure
From: Vishal Moola (Oracle)
Date: Tue Mar 03 2026 - 15:07:32 EST
On Mon, Mar 02, 2026 at 12:47:39PM +0100, Uladzislau Rezki (Sony) wrote:
> When __vmalloc_area_node() fails to allocate pages, the failure
> message may report an incorrect allocation size, for example:
>
> vmalloc error: size 0, failed to allocate pages, ...
>
> This happens because the warning prints area->nr_pages * PAGE_SIZE.
> At this point, area->nr_pages may be zero or partly populated thus
> it is not valid.
>
> Report the originally requested allocation size instead by using
> nr_small_pages * PAGE_SIZE, which reflects the actual number of
> pages being requested by user.
>
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@xxxxxxxxx>