From: Chao Yu <chao@kernel.org>
To: Sheng Yong <shengyong@oppo.com>, jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] f2fs: fix start segno of large section
Date: Mon, 8 Jul 2024 14:09:13 +0800 [thread overview]
Message-ID: <5919b47f-616a-441d-bfe8-9c03739b61d7@kernel.org> (raw)
In-Reply-To: <20240706091634.1970874-1-shengyong@oppo.com>
On 2024/7/6 17:16, Sheng Yong wrote:
> get_ckpt_valid_blocks() checks valid ckpt blocks in current section.
> It counts all vblocks from the first to the last segment in the
> large section. However, START_SEGNO() is used to get the first segno
> in an SIT block. This patch fixes that to get the correct start segno.
>
> Fixes: 61461fc921b7 ("f2fs: fix to avoid touching checkpointed data in get_victim()")
> Signed-off-by: Sheng Yong <shengyong@oppo.com>
> ---
> fs/f2fs/segment.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
> index e1c0f418aa11..6ed5bc811d2c 100644
> --- a/fs/f2fs/segment.h
> +++ b/fs/f2fs/segment.h
> @@ -347,7 +347,8 @@ static inline unsigned int get_ckpt_valid_blocks(struct f2fs_sb_info *sbi,
> unsigned int segno, bool use_section)
> {
> if (use_section && __is_large_section(sbi)) {
> - unsigned int start_segno = START_SEGNO(segno);
> + unsigned int start_segno = segno / SEGS_PER_SEC(sbi) *
> + SEGS_PER_SEC(sbi);
How about using macro?
unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
unsigned int start_seno = GET_SEG_FROM_SEC(sbi, secno);
Thanks,
> unsigned int blocks = 0;
> int i;
>
next prev parent reply other threads:[~2024-07-08 6:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-06 9:16 [PATCH] f2fs: fix start segno of large section Sheng Yong
2024-07-08 6:09 ` Chao Yu [this message]
2024-07-08 6:18 ` Sheng Yong
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=5919b47f-616a-441d-bfe8-9c03739b61d7@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=shengyong@oppo.com \
/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