Re: [PATCH v4 2/2] f2fs: refresh pinned allocation boundary after resize

From: Chao Yu

Date: Mon Oct 19 2026 - 07:06:30 EST




On 10/16/26 13:44, Wenjie Qi wrote:
> Online shrink updates MAIN_SECS() but leaves resizable_tail_secno and
> pinned_area_max_secno unchanged. The pinned allocation limit can exceed
> the new main area when shrinking beyond the reserved tail.
>
> Consume the reserved tail by the number of removed sections, clamping
> it to zero, before refreshing the shared pinned allocation boundary.
> This preserves the boundary while shrinking within the reservation and
> limits it to the new main area otherwise, retaining the zoned limit.
>
> Save the old tail count and restore it before rolling back the geometry
> if the final checkpoint fails.
>
> Also bound pinned section allocation by the current MAIN_SECS(). Range
> evacuation temporarily reduces it before moving cursegs, while the
> cached pinned boundary still describes the old geometry. Otherwise, a
> pinned curseg can be reallocated into the range being removed.
>
> Fixes: c966d29e01bb ("f2fs: support resizable tail section and unify pinned allocation")
> Suggested-by: Daeho Jeong <daehojeong@xxxxxxxxxx>
> Signed-off-by: Wenjie Qi <qiwenjie@xxxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,