Commit 8c409989 authored by Sheng Yong's avatar Sheng Yong Committed by Jaegeuk Kim

f2fs: fix start segno of large section

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: 61461fc9 ("f2fs: fix to avoid touching checkpointed data in get_victim()")
Signed-off-by: default avatarSheng Yong <shengyong@oppo.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 388a2a06
...@@ -347,7 +347,8 @@ static inline unsigned int get_ckpt_valid_blocks(struct f2fs_sb_info *sbi, ...@@ -347,7 +347,8 @@ static inline unsigned int get_ckpt_valid_blocks(struct f2fs_sb_info *sbi,
unsigned int segno, bool use_section) unsigned int segno, bool use_section)
{ {
if (use_section && __is_large_section(sbi)) { if (use_section && __is_large_section(sbi)) {
unsigned int start_segno = START_SEGNO(segno); unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
unsigned int start_segno = GET_SEG_FROM_SEC(sbi, secno);
unsigned int blocks = 0; unsigned int blocks = 0;
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment