Re: [PATCH v4] btrfs: Use larger zlib buffer for s390 hardware compression

From: Zaslonko Mikhail
Date: Mon Jan 13 2020 - 05:03:39 EST


Hello David,

On 09.01.2020 02:10, David Sterba wrote:
> On Wed, Jan 08, 2020 at 07:48:31PM +0100, Zaslonko Mikhail wrote:
>>>> +ÂÂÂÂÂÂÂ } else if (workspace->strm.avail_out == 0) {
>>>> +ÂÂÂÂÂÂÂÂÂÂÂ /* get another page for the stream end */
>>>> +ÂÂÂÂÂÂÂÂÂÂÂ kunmap(out_page);
>>>> +ÂÂÂÂÂÂÂÂÂÂÂ if (nr_pages == nr_dest_pages) {
>>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ out_page = NULL;
>>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ret = -E2BIG;
>>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ goto out;
>>>> +ÂÂÂÂÂÂÂÂÂÂÂ }
>>>> +ÂÂÂÂÂÂÂÂÂÂÂ out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);
>>>> +ÂÂÂÂÂÂÂÂÂÂÂ if (out_page == NULL) {
>>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ret = -ENOMEM;
>>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ goto out;
>>>> +ÂÂÂÂÂÂÂÂÂÂÂ }
>>>
>>> Do we need zlib_deflateEnd() for the above error cases? Thanks,
>>
>> The original btrfs code did not call zlib_deflateEnd() for -E2BIG and
>> -ENOMEM cases, so I stick to the same logic.
>> Unlike userspace zlib where deflateEnd() frees all dynamically allocated
>> memory, in the kernel it doesn't do much apart from setting the return
>> code (since all the memory allocations for kernel zlib are performed in advance).
>
> Agreed, deflateEnd is not necessary in the error cases.

Can I consider this as 'Acked-by' from your side?
Are there any unanswered questions left on this patch?

>

Thanks,
Mikhail