Re: [PATCH] zram: Fix the issue that the write - back limits might overflow

From: Sergey Senozhatsky
Date: Tue Nov 18 2025 - 02:53:19 EST


On (25/11/18 15:39), Yuwen Chen wrote:
> Since the value of bd_wb_limit is an unsigned number, when the
> page size is larger than 4 KB, it may cause an out-of-bounds situation.
>
> This patch fixes the issue by limiting bd_wb_limit to be an
> integer multiple of PAGE_SIZE / 4096.

I really wish we could just change wb code to use PAGE_SIZE not 4K
units [1], unfortunately it's probably too late to change that now.

[1] https://lore.kernel.org/linux-kernel/20251110052741.92031-1-senozhatsky@xxxxxxxxxxxx