Re: [PATCH v2] f2fs: skip further SIT updates for already invalidated blocks
From: Chao Yu
Date: Tue Dec 01 2026 - 03:11:14 EST
On 11/7/26 14:18, Seongjae Jeong wrote:
> When update_sit_entry_for_release() encounters a block whose bit is
> already cleared in cur_valid_map, it reports the inconsistency and
> corrects se->valid_blocks and del. However, it still proceeds with
> the discard bitmap and checkpoint accounting updates.
>
> This can clear the discard bit unnecessarily and incorrectly decrement
> the segment and section ckpt_valid_blocks counters when the block is
> not marked in ckpt_valid_map.
>
> Continue to the next block after correcting se->valid_blocks and del,
> so that an already invalidated block does not trigger further discard
> bitmap or checkpoint counter updates.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 81ffbd224e5f ("f2fs: update_sit_entry_for_release() supports consecutive blocks.")
> Fixes: a66cdd985532 ("f2fs: introduce discard_map for f2fs_trim_fs")
Should use Fixes: 81ffbd224e5f ("f2fs: update_sit_entry_for_release() supports
consecutive blocks.") instead of above two Fixes lines as discussed w/ Seongjae in
https://lore.kernel.org/linux-f2fs-devel/CAPHXVrx8AESeQdo+nsnHZsBaJ4=_t00cqaT6G1TGh-JLN_pHog@xxxxxxxxxxxxxx
> Signed-off-by: Seongjae Jeong <jsjlee1020@xxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
Thanks,