[v4 PATCH 10/13] ubifs: Use crypto_acomp interface

Zhihao Cheng chengzhihao1 at huawei.com
Sat Mar 15 02:27:22 PDT 2025


在 2025/3/15 17:12, Herbert Xu 写道:
> On Sat, Mar 15, 2025 at 05:08:47PM +0800, Zhihao Cheng wrote:
>>
>> According to the warning message, current compressor is zstd. The output
>> buffer size is limited only for LZO compressor by [1].
> 
> Any algorithm can and will produce output longer than the input,
> if you give it enough output buffer.
> 
> Previously an output buffer length of 2x the input length was given
> to all algorithms, meaning that they would all succeed no matter
> whether the input can be compressed or not.
> 
> This has now been changed so that incompressible data is not
> needlessly compressed all the way to the end.  In fact we should
> reduce it further to eliminate the UBIFS_MIN_COMPRESS_DIFF check.

Ah, I get it. Thanks for reminding, and I verify that the root cause is 
the output buffer becomes smaller.
> 
> I will remove the warning on compression since failures are
> expected and reduce the output buffer length further to remove
> the post-compression length check.
> 

I think we should keep the warning, it would be better to distinguish 
the different error types.



More information about the linux-mtd mailing list