aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2022-10-06 23:16:06 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2022-10-10 13:24:56 -0700
commitbdd51e53042490b573629fe172047ef0519c7832 (patch)
tree75cf9a704af2b5d1418cdac45ebfe6c8f8c48f77
parent5a5e419d51d7f7a3019a903a4b3f9b8d6e2a872a (diff)
downloadf2fs-tools-bdd51e53042490b573629fe172047ef0519c7832.tar.gz
fsck.f2fs: fix __end_block_addr()
The calculation is wrong, fix it. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fsck/f2fs.h5
1 files 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) \