On Feb 11, 2025, at 00:25, Kent Overstreet <kent.overstr...@linux.dev> wrote:
> 
> On Mon, Feb 10, 2025 at 11:04:21AM +0800, Alan Huang wrote:
>> Since we don't merge compressed extents, uncompressed_size should be
>> equal to compressed_size, use uncompressed_size to clarify the intention.
> 
> compressed_size actually describes the intention better here, it refers
> to size ondisk, and we're checking if the extents are contiguous on disk

But we don’t merge compressed extents.

There is is_compressed check above (below compressed_size check in the past as 
the history says)

Not sure if it’s my problem, but I spent hours before figuring out that we're 
checking if the extents are contiguous on disk.

> 
>> 
>> Signed-off-by: Alan Huang <mmpgour...@gmail.com>
>> ---
>> fs/bcachefs/extents.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
>> index 05d5f71a7ca9..eeea23d09b9a 100644
>> --- a/fs/bcachefs/extents.c
>> +++ b/fs/bcachefs/extents.c
>> @@ -326,7 +326,7 @@ bool bch2_extent_merge(struct bch_fs *c, struct bkey_s 
>> l, struct bkey_s_c r)
>>    !bch2_checksum_mergeable(lp.crc.csum_type))
>> return false;
>> 
>> - if (lp.crc.offset + lp.crc.live_size != lp.crc.compressed_size ||
>> + if (lp.crc.offset + lp.crc.live_size != lp.crc.uncompressed_size ||
>>    rp.crc.offset)
>> return false;
>> 
>> -- 
>> 2.47.0
>> 


Reply via email to