Re: [f2fs-dev] [PATCH] fsck.f2fs: enable fix_on when CP_RESIZEFS_FLAG is set in auto-fix mode

From: Chao Yu

Date: Mon Oct 12 2026 - 22:03:46 EST


On 10/2/26 02:07, Daeho Jeong wrote:
From: Daeho Jeong <daehojeong@xxxxxxxxxx>

Commit 9a31cefa2966 ("fsck.f2fs: allow fsck to fix issues with online
resize due to SPO") added logic in sanity_check_ckpt() to recalculate
and fix user_block_count when CP_RESIZEFS_FLAG is set after a sudden
power-off during online resize.

However, sanity_check_ckpt() calls f2fs_should_proceed() and checks
c.fix_on before repairing user_block_count, while f2fs_should_proceed()
did not check CP_RESIZEFS_FLAG when setting c.fix_on in auto_fix (-a) or
preen (-p) mode. As a result, running 'fsck.f2fs -a' after an SPO during
online shrink leaves c.fix_on unset and fails to repair the checkpoint.

Check CP_RESIZEFS_FLAG in f2fs_should_proceed() so that auto-fix and
preen modes properly enable c.fix_on and recover the filesystem.

Fixes: 9a31cefa2966 ("fsck.f2fs: allow fsck to fix issues with online resize due to SPO")
Signed-off-by: Daeho Jeong <daehojeong@xxxxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,