From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Chunhai Guo <guochunhai@vivo.com>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] fsck.f2fs: drop unused SB_ENCODE_FLAG
Date: Mon, 15 Jun 2026 22:07:51 +0000 [thread overview]
Message-ID: <ajB3t-bWsdKhiiY-@google.com> (raw)
In-Reply-To: <20260605100559.94843-1-guochunhai@vivo.com>
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
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chunhai Guo <guochunhai@vivo.com>
Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fsck.f2fs: drop unused SB_ENCODE_FLAG
Date: Mon, 15 Jun 2026 22:07:51 +0000 [thread overview]
Message-ID: <ajB3t-bWsdKhiiY-@google.com> (raw)
In-Reply-To: <20260605100559.94843-1-guochunhai@vivo.com>
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
>
next prev parent reply other threads:[~2026-06-15 22:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 10:05 [PATCH] fsck.f2fs: drop unused SB_ENCODE_FLAG Chunhai Guo
2026-06-05 10:05 ` [f2fs-dev] " Chunhai Guo via Linux-f2fs-devel
2026-06-15 22:07 ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2026-06-15 22:07 ` Jaegeuk Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ajB3t-bWsdKhiiY-@google.com \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=guochunhai@vivo.com \
--cc=jaegeuk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.