Re: [PATCH v3 13/19] ext4: call ext4_mb_mark_group_bb in ext4_free_blocks_simple

From: Kemeng Shi
Date: Sun May 14 2023 - 07:47:30 EST




on 5/14/2023 5:32 PM, Ojaswin Mujoo wrote:
> On Mon, Apr 17, 2023 at 07:06:11PM +0800, Kemeng Shi wrote:
>> call ext4_mb_mark_group_bb in ext4_free_blocks_simple to:
>> 1. remove repeat code
>> 2. pair update of free_clusters in ext4_mb_new_blocks_simple.
>> 3. add missing ext4_lock_group/ext4_unlock_group protection.
>>
>> Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>
>
> Correct me if I'm wrong but I think we will never try to clear bitmap
> bits for a BLOCK_UNINIT BG right. Maybe if that's the case we can add a
> WARN_ON as follows in ext4_mb_mark_group_bb():
>
> if (ext4_has_group_desc_csum(sb) &&
> (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))) {
>
> WARN_ON(mc->state == 0);
> ...
>
> }

Yes, bitmap clear for BLOCK_UNINIT block group should not happen , I will
add this in next version. Thanks for the suggestion.

--
Best wishes
Kemeng Shi