Re: [PATCH v2 1/2] f2fs: fix changing cursegs if recovery fails on zoned device

From: Chao Yu
Date: Mon Nov 18 2024 - 20:11:42 EST


On 2024/11/18 20:05, Sheng Yong wrote:
Fsync data recovery attempts to check and fix write pointer consistency
of cursegs and all other zones. If the write pointers of cursegs are
unaligned, cursegs are changed to new sections.

If recovery fails, zone write pointers are still checked and fixed,
but the latest checkpoint cannot be written back. Additionally, retry-
mount skips recovery and rolls back to reuse the old cursegs whose
zones are already finished. This can lead to unaligned write later.

This patch addresses the issue by leaving writer pointers untouched if
recovery fails. When retry-mount is performed, cursegs and other zones
are checked and fixed after skipping recovery.

Signed-off-by: Song Feng <songfeng@xxxxxxxx>
Signed-off-by: Yongpeng Yang <yangyongpeng1@xxxxxxxx>
Signed-off-by: Sheng Yong <shengyong@xxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,