Skip to content

Commit 8c40998

Browse files
Sheng YongJaegeuk Kim
authored andcommitted
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: 61461fc ("f2fs: fix to avoid touching checkpointed data in get_victim()") Signed-off-by: Sheng Yong <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 388a2a0 commit 8c40998

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/f2fs/segment.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ static inline unsigned int get_ckpt_valid_blocks(struct f2fs_sb_info *sbi,
347347
unsigned int segno, bool use_section)
348348
{
349349
if (use_section && __is_large_section(sbi)) {
350-
unsigned int start_segno = START_SEGNO(segno);
350+
unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
351+
unsigned int start_segno = GET_SEG_FROM_SEC(sbi, secno);
351352
unsigned int blocks = 0;
352353
int i;
353354

0 commit comments

Comments
 (0)