Skip to content

Commit 4356306

Browse files
Yongpeng YangJaegeuk Kim
authored andcommitted
f2fs: check curseg->inited before write_sum_page in change_curseg
In the __f2fs_init_atgc_curseg->get_atssr_segment calling, curseg->segno is NULL_SEGNO, indicating that there is no summary block that needs to be written. Fixes: 093749e ("f2fs: support age threshold based garbage collection") Signed-off-by: Yongpeng Yang <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent c3af1f1 commit 4356306

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/f2fs/segment.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2926,7 +2926,8 @@ static int change_curseg(struct f2fs_sb_info *sbi, int type)
29262926
struct f2fs_summary_block *sum_node;
29272927
struct page *sum_page;
29282928

2929-
write_sum_page(sbi, curseg->sum_blk, GET_SUM_BLOCK(sbi, curseg->segno));
2929+
if (curseg->inited)
2930+
write_sum_page(sbi, curseg->sum_blk, GET_SUM_BLOCK(sbi, curseg->segno));
29302931

29312932
__set_test_and_inuse(sbi, new_segno);
29322933

0 commit comments

Comments
 (0)