* [f2fs-dev] [PATCH] fsck.f2fs: enable fix_on when CP_RESIZEFS_FLAG is set in auto-fix mode
@ 2026-10-01 18:07 Daeho Jeong
2026-10-12 18:46 ` Daeho Jeong
2026-10-13 2:03 ` Chao Yu via Linux-f2fs-devel
0 siblings, 2 replies; 3+ messages in thread
From: Daeho Jeong @ 2026-10-01 18:07 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong
From: Daeho Jeong <daehojeong@google.com>
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@google.com>
---
fsck/mount.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fsck/mount.c b/fsck/mount.c
index 2fd8e1c..8479ed1 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -1515,6 +1515,7 @@ static int f2fs_should_proceed(struct f2fs_super_block *sb, u32 flag)
if (!c.fix_on && (c.auto_fix || c.preen_mode)) {
if (flag & CP_FSCK_FLAG ||
flag & CP_DISABLED_FLAG ||
+ flag & CP_RESIZEFS_FLAG ||
flag & CP_QUOTA_NEED_FSCK_FLAG ||
c.invalid_sb & SB_NEED_FIX ||
(exist_qf_ino(sb) && (flag & CP_ERROR_FLAG))) {
--
2.56.0.rc1.315.gc6ed9934b7-goog
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [f2fs-dev] [PATCH] fsck.f2fs: enable fix_on when CP_RESIZEFS_FLAG is set in auto-fix mode
2026-10-01 18:07 [f2fs-dev] [PATCH] fsck.f2fs: enable fix_on when CP_RESIZEFS_FLAG is set in auto-fix mode Daeho Jeong
@ 2026-10-12 18:46 ` Daeho Jeong
2026-10-13 2:03 ` Chao Yu via Linux-f2fs-devel
1 sibling, 0 replies; 3+ messages in thread
From: Daeho Jeong @ 2026-10-12 18:46 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong
On Thu, Oct 1, 2026 at 11:08 AM Daeho Jeong <daeho43@gmail.com> wrote:
>
> From: Daeho Jeong <daehojeong@google.com>
>
> 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@google.com>
> ---
> fsck/mount.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fsck/mount.c b/fsck/mount.c
> index 2fd8e1c..8479ed1 100644
> --- a/fsck/mount.c
> +++ b/fsck/mount.c
> @@ -1515,6 +1515,7 @@ static int f2fs_should_proceed(struct f2fs_super_block *sb, u32 flag)
> if (!c.fix_on && (c.auto_fix || c.preen_mode)) {
> if (flag & CP_FSCK_FLAG ||
> flag & CP_DISABLED_FLAG ||
> + flag & CP_RESIZEFS_FLAG ||
> flag & CP_QUOTA_NEED_FSCK_FLAG ||
> c.invalid_sb & SB_NEED_FIX ||
> (exist_qf_ino(sb) && (flag & CP_ERROR_FLAG))) {
> --
Kindly ping this.
Thanks,
> 2.56.0.rc1.315.gc6ed9934b7-goog
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [f2fs-dev] [PATCH] fsck.f2fs: enable fix_on when CP_RESIZEFS_FLAG is set in auto-fix mode
2026-10-01 18:07 [f2fs-dev] [PATCH] fsck.f2fs: enable fix_on when CP_RESIZEFS_FLAG is set in auto-fix mode Daeho Jeong
2026-10-12 18:46 ` Daeho Jeong
@ 2026-10-13 2:03 ` Chao Yu via Linux-f2fs-devel
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-10-13 2:03 UTC (permalink / raw)
To: Daeho Jeong, linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong
On 10/2/26 02:07, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
>
> 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@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-13 2:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 18:07 [f2fs-dev] [PATCH] fsck.f2fs: enable fix_on when CP_RESIZEFS_FLAG is set in auto-fix mode Daeho Jeong
2026-10-12 18:46 ` Daeho Jeong
2026-10-13 2:03 ` Chao Yu via Linux-f2fs-devel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.