[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1hqP7E_H96rMscS@sashalap>
Date: Tue, 10 Dec 2024 11:20:15 -0500
From: Sasha Levin <sashal@...nel.org>
To: David Sterba <dsterba@...e.cz>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Qu Wenruo <wqu@...e.com>, David Sterba <dsterba@...e.com>,
clm@...com, josef@...icpanda.com, linux-btrfs@...r.kernel.org
Subject: Re: [PATCH AUTOSEL 6.12 09/19] btrfs: zlib: make the compression
path to handle sector size < page size
On Mon, Nov 25, 2024 at 04:20:59PM +0100, David Sterba wrote:
>On Sun, Nov 24, 2024 at 07:38:44AM -0500, Sasha Levin wrote:
>> From: Qu Wenruo <wqu@...e.com>
>>
>> [ Upstream commit f6ebedb09bb276256e084196e2322562dc4aac10 ]
>>
>> Inside zlib_compress_folios(), each time we switch the input page cache,
>> the @start is increased by PAGE_SIZE.
>>
>> But for the incoming compression support for sector size < page size
>> (previously we support compression only when the range is fully page
>> aligned), this is not going to handle the following case:
>>
>> 0 32K 64K 96K
>> | |///////////||///////////|
>>
>> @start has the initial value 32K, indicating the start filepos of the
>> to-be-compressed range.
>>
>> And when grabbing the first page as input, we always call "start +=
>> PAGE_SIZE;".
>>
>> But since @start is starting at 32K, it will be increased by 64K,
>> resulting it to be 96K for the next range, causing incorrect input range
>> and corruption for the future subpage compression.
>>
>> Fix it by only increase @start by the input size.
>>
>> Signed-off-by: Qu Wenruo <wqu@...e.com>
>> Signed-off-by: David Sterba <dsterba@...e.com>
>> Signed-off-by: Sasha Levin <sashal@...nel.org>
>
>Please drop this patch from stable, it's preparatory work and has
>otherwise no effect.
Will do, thanks!
--
Thanks,
Sasha
Powered by blists - more mailing lists