Re: [PATCH v2 07/11] zswap: do not free the entry if its pool is NULL

From: Nhat Pham

Date: Tue Nov 10 2026 - 13:21:19 EST


On Mon, Nov 9, 2026 at 10:49 PM Sergey Senozhatsky
<senozhatsky@xxxxxxxxxxxx> wrote:
>
> zswap_entry_free() warns if the entry has no pool (which should never
> happen), skips zs_free() and then frees the entry. A subsequent patch
> embeds zsmalloc handle into zswap_entry, so zsmalloc object will point
> to the entry, and we cannot free the entry while the object is still
> there.
>
> Bail out early and leak the entry, its cgroup charge and stats instead.
>
> Suggested-by: Yosry Ahmed <yosry@xxxxxxxxxx>
> Signed-off-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>

Acked-by: Nhat Pham <nphamcs@xxxxxxxxx>