Re: [PATCH v2 5/8] ext4: correct the journal credits calculations of allocating blocks

Zhang Yi
2025-05-20T13:05:01Z

On 2025/5/19 23:48, Theodore Ts'o wrote:
> On Mon, May 19, 2025 at 10:48:28AM +0800, Zhang Yi wrote:
>>
>> This patch conflicts with Jan's patch e18d4f11d240 ("ext4: fix
>> calculation of credits for extent tree modification") in
>> ext4_ext_index_trans_blocks(), the conflict should be resolved when
>> merging this patch. However, I checked the merged commit of this patch
>> in your dev branch[1], and the changes in ext4_ext_index_trans_blocks()
>> seem to be incorrect, which could result in insufficient credit
>> reservations on 1K block size filesystems.
>
> Thanks so much for noticing the mis-merge! I've fixed it in my tree,
> and will be pushing it out shortly. If you could take a look and make
> sure that it's correct, that would be great.
>

The merge in ext4_ext_index_trans_blocks() appears to be correct now.
However, the issue that Jan pointed out regarding the modification in
ext4_meta_trans_blocks() is correct, it will also lead to insufficient
credit reservations on some corner images. I will send out a fix ASAP.

Best Regards.
Yi.