Re: [PATCH v2 10/15] lib/lz4: switch the compressor to the vendored sources

From: Michal Wilczynski

Date: Thu Nov 12 2026 - 07:12:07 EST




On 11/10/26 06:36, Sergey Senozhatsky wrote:
> On (26/11/06 15:42), Michal Wilczynski wrote:
> [..]
>> diff --git a/drivers/block/zram/backend_lz4.c b/drivers/block/zram/backend_lz4.c
>> index 1e4ad31d39a63f45b3bddd3d8a467d8d7d095beb..50265e3ce256490994cb6dae32a45da376e408e0 100644
>> --- a/drivers/block/zram/backend_lz4.c
>> +++ b/drivers/block/zram/backend_lz4.c
>> @@ -42,7 +42,7 @@ static int lz4_setup_params(struct zcomp_params *params)
>> if (!params->dict || !params->dict_sz)
>> return 0;
>>
>> - dict_stream = kzalloc_obj(*dict_stream);
>> + dict_stream = kzalloc(LZ4_MEM_COMPRESS, GFP_KERNEL);
>> if (!dict_stream)
>> return -ENOMEM;
>>
>> @@ -88,7 +88,7 @@ static int lz4_create(struct zcomp_params *params, struct zcomp_ctx *ctx)
>> if (!zctx->dstrm)
>> goto error;
>>
>> - zctx->cstrm = kzalloc_obj(*zctx->cstrm);
>> + zctx->cstrm = kzalloc(LZ4_MEM_COMPRESS, GFP_KERNEL);
>> if (!zctx->cstrm)
>> goto error;
>> }
>> @@ -112,7 +112,7 @@ static int lz4_compress(struct zcomp_params *params, struct zcomp_ctx *ctx,
>> zctx->mem);
>> } else {
>> /* Cstrm needs to be reset */
>> - memcpy(zctx->cstrm, params->drv_data, sizeof(*zctx->cstrm));
>> + memcpy(zctx->cstrm, params->drv_data, LZ4_MEM_COMPRESS);
>> ret = LZ4_compress_fast_continue(zctx->cstrm, req->src,
>> req->dst, req->src_len,
>> req->dst_len, params->level);
>
> The zram code here is outdated, it has been reworked quite a bit
> (patches are in linux-next and Andrew's trees).
>

Right, I'll rebase on linux-next.

Best regards,
--
Michal Wilczynski <m.wilczynski@xxxxxxxxxxx>