Re: Clarification on last_comp_len logic in zram_write_page

From: Sergey Senozhatsky
Date: Fri Dec 13 2024 - 03:00:37 EST


On (24/12/13 12:49), Dheeraj Reddy Jonnalagadda wrote:
> I am writing to seek clarification regarding the use of last_comp_len
> variable in zram_write_page function. Specifically, Coverity has flagged
> the issue (CID 1602439) in zram/zram_drv.c
>
> Currently, last_comp_len is initialized to 0 but never updated within the
> function. This renders the conditional block shown below as dead code.
>
> if (last_comp_len && (last_comp_len != comp_len)) {
> zs_free(zram->mem_pool, handle);
> handle = -ENOMEM;
> }

That's a "known issue" [1], I deleted one extra line during rebase.
However, I expect last_comp_len patch do get withdrawn soon [2].

[1] https://lore.kernel.org/linux-kernel/20241211100638.GA2228457@xxxxxxxxxx
[2] https://lore.kernel.org/mm-commits/3awo2svbnsv2mvozhaqspwztgxhifphj7ffpmykc35py6wp6ol@xlt2q5qgv6c3