From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix wrong segment count
Date: Mon, 13 Feb 2023 17:41:58 +0800 [thread overview]
Message-ID: <1a66e32b-efc0-626b-b585-7f2bfac506a7@kernel.org> (raw)
In-Reply-To: <20230210213250.3471246-1-jaegeuk@kernel.org>
On 2023/2/11 5:32, Jaegeuk Kim wrote:
> MAIN_SEGS is for data area, while TOTAL_SEGS includes data and metadata.
Good catch!
Could you please add fixes line?
Thanks,
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/segment.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
> index 8ee5e5db9287..6003fbaf4b7d 100644
> --- a/fs/f2fs/segment.h
> +++ b/fs/f2fs/segment.h
> @@ -720,7 +720,7 @@ static inline unsigned char curseg_alloc_type(struct f2fs_sb_info *sbi,
>
> static inline void check_seg_range(struct f2fs_sb_info *sbi, unsigned int segno)
> {
> - f2fs_bug_on(sbi, segno > TOTAL_SEGS(sbi) - 1);
> + f2fs_bug_on(sbi, segno > MAIN_SEGS(sbi) - 1);
> }
>
> static inline void verify_fio_blkaddr(struct f2fs_io_info *fio)
> @@ -775,7 +775,7 @@ static inline int check_block_count(struct f2fs_sb_info *sbi,
>
> /* check segment usage, and check boundary of a given segment number */
> if (unlikely(GET_SIT_VBLOCKS(raw_sit) > usable_blks_per_seg
> - || segno > TOTAL_SEGS(sbi) - 1)) {
> + || segno > MAIN_SEGS(sbi) - 1)) {
> f2fs_err(sbi, "Wrong valid blocks %d or segno %u",
> GET_SIT_VBLOCKS(raw_sit), segno);
> set_sbi_flag(sbi, SBI_NEED_FSCK);
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2023-02-13 9:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 21:32 [f2fs-dev] [PATCH] f2fs: fix wrong segment count Jaegeuk Kim
2023-02-13 9:41 ` Chao Yu [this message]
2023-02-13 17:48 ` Jaegeuk Kim
2023-02-14 1:30 ` Chao Yu
2023-02-14 18:00 ` Jaegeuk Kim
2023-02-13 17:59 ` [f2fs-dev] [PATCH v2] " 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=1a66e32b-efc0-626b-b585-7f2bfac506a7@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).