* [PATCH] fsck.f2fs: drop unused SB_ENCODE_FLAG
@ 2026-06-05 10:05 Chunhai Guo
2026-06-15 22:07 ` Jaegeuk Kim
0 siblings, 1 reply; 2+ messages in thread
From: Chunhai Guo @ 2026-06-05 10:05 UTC (permalink / raw)
To: chao, jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, Chunhai Guo
Since commit 29c1e18a0bc5 ("fsck.f2fs: tune linear_lookup in
f2fs_do_mount()"), fsck_update_sb_flags() writes the superblock directly
and nothing sets c.invalid_sb with SB_ENCODE_FLAG anymore. Drop the dead
flag and simplify the SB_NEED_FIX check.
BTW, SB_ENCODE_FLAG should originally have been 0x10, not 0x16, since
invalid_sb is a bitmask.
Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
---
fsck/fsck.c | 2 +-
include/f2fs_fs.h | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 4fca4dd7eb1b..85766118d04a 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -4001,7 +4001,7 @@ int fsck_verify(struct f2fs_sb_info *sbi)
if (c.invalid_sb & SB_FS_ERRORS)
memset(sb->s_errors, 0, MAX_F2FS_ERRORS);
- if (c.invalid_sb & (SB_NEED_FIX | SB_ENCODE_FLAG))
+ if (c.invalid_sb & SB_NEED_FIX)
update_superblock(sb, SB_MASK_ALL);
/* to return FSCK_ERROR_CORRECTED */
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 21310fa6a1af..07772da6e67d 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -1477,9 +1477,8 @@ enum {
#define SB_ABNORMAL_STOP 0x2 /* s_stop_reason is set except shutdown */
#define SB_FS_ERRORS 0x4 /* s_erros is set */
#define SB_INVALID 0x8 /* sb is invalid */
-#define SB_ENCODE_FLAG 0x16 /* encode_flag */
#define SB_NEED_FIX (SB_ABNORMAL_STOP | SB_FS_ERRORS | \
- SB_INVALID | SB_ENCODE_FLAG)
+ SB_INVALID)
#define MAX_CACHE_SUMS 8
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] fsck.f2fs: drop unused SB_ENCODE_FLAG
2026-06-05 10:05 [PATCH] fsck.f2fs: drop unused SB_ENCODE_FLAG Chunhai Guo
@ 2026-06-15 22:07 ` Jaegeuk Kim
0 siblings, 0 replies; 2+ messages in thread
From: Jaegeuk Kim @ 2026-06-15 22:07 UTC (permalink / raw)
To: Chunhai Guo; +Cc: chao, linux-f2fs-devel, linux-kernel
On 06/05, Chunhai Guo wrote:
> Since commit 29c1e18a0bc5 ("fsck.f2fs: tune linear_lookup in
> f2fs_do_mount()"), fsck_update_sb_flags() writes the superblock directly
> and nothing sets c.invalid_sb with SB_ENCODE_FLAG anymore. Drop the dead
> flag and simplify the SB_NEED_FIX check.
What if the tool runs without that kernel change?
>
> BTW, SB_ENCODE_FLAG should originally have been 0x10, not 0x16, since
> invalid_sb is a bitmask.
>
> Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
> ---
> fsck/fsck.c | 2 +-
> include/f2fs_fs.h | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/fsck/fsck.c b/fsck/fsck.c
> index 4fca4dd7eb1b..85766118d04a 100644
> --- a/fsck/fsck.c
> +++ b/fsck/fsck.c
> @@ -4001,7 +4001,7 @@ int fsck_verify(struct f2fs_sb_info *sbi)
> if (c.invalid_sb & SB_FS_ERRORS)
> memset(sb->s_errors, 0, MAX_F2FS_ERRORS);
>
> - if (c.invalid_sb & (SB_NEED_FIX | SB_ENCODE_FLAG))
> + if (c.invalid_sb & SB_NEED_FIX)
> update_superblock(sb, SB_MASK_ALL);
>
> /* to return FSCK_ERROR_CORRECTED */
> diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
> index 21310fa6a1af..07772da6e67d 100644
> --- a/include/f2fs_fs.h
> +++ b/include/f2fs_fs.h
> @@ -1477,9 +1477,8 @@ enum {
> #define SB_ABNORMAL_STOP 0x2 /* s_stop_reason is set except shutdown */
> #define SB_FS_ERRORS 0x4 /* s_erros is set */
> #define SB_INVALID 0x8 /* sb is invalid */
> -#define SB_ENCODE_FLAG 0x16 /* encode_flag */
> #define SB_NEED_FIX (SB_ABNORMAL_STOP | SB_FS_ERRORS | \
> - SB_INVALID | SB_ENCODE_FLAG)
> + SB_INVALID)
>
> #define MAX_CACHE_SUMS 8
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-15 22:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05 10:05 [PATCH] fsck.f2fs: drop unused SB_ENCODE_FLAG Chunhai Guo
2026-06-15 22:07 ` Jaegeuk Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox