Re: [PATCH] lib/lzo: Avoid output overruns when compressing
From: Sergey Senozhatsky
Date: Fri Feb 28 2025 - 00:24:33 EST
On (25/02/26 14:00), David Sterba wrote:
> What strikes me as alarming that you insert about 20 branches into a
> realtime compression algorithm, where everything is basically a hot
> path. Branches that almost never happen, and never if the output buffer
> is big enough.
>
> Please drop the patch.
David, just for educational purposes, there's only safe variant of lzo
decompression, which seems to be doing a lot of NEED_OP (HAVE_OP) adding
branches and so on, basically what Herbert is adding to the compression
path. So my question is - why NEED_OP (if (!HAVE_OP(x)) goto output_overrun)
is a no go for compression, but appears to be fine for decompression?