From: Chao Yu <chao@kernel.org>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH] fsck.f2fs: fix __end_block_addr()
Date: Thu, 6 Oct 2022 23:16:06 +0800 [thread overview]
Message-ID: <20221006151606.58288-1-chao@kernel.org> (raw)
The calculation is wrong, fix it.
Signed-off-by: Chao Yu <chao@kernel.org>
---
fsck/f2fs.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fsck/f2fs.h b/fsck/f2fs.h
index 030d750..2fd241f 100644
--- a/fsck/f2fs.h
+++ b/fsck/f2fs.h
@@ -416,8 +416,9 @@ static inline block_t __start_sum_addr(struct f2fs_sb_info *sbi)
static inline block_t __end_block_addr(struct f2fs_sb_info *sbi)
{
- block_t end = SM_I(sbi)->main_blkaddr;
- return end + le64_to_cpu(F2FS_RAW_SUPER(sbi)->block_count);
+ return SM_I(sbi)->main_blkaddr +
+ (le32_to_cpu(F2FS_RAW_SUPER(sbi)->segment_count_main) <<
+ sbi->log_blocks_per_seg);
}
#define GET_ZONENO_FROM_SEGNO(sbi, segno) \
--
2.36.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
reply other threads:[~2022-10-06 15:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221006151606.58288-1-chao@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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).