Commit 43563069 authored by Yongpeng Yang's avatar Yongpeng Yang Committed by Jaegeuk Kim
Browse files

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: 093749e2 ("f2fs: support age threshold based garbage collection")
Signed-off-by: default avatarYongpeng Yang <yangyongpeng1@oppo.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent c3af1f13
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2926,6 +2926,7 @@ static int change_curseg(struct f2fs_sb_info *sbi, int type)
	struct f2fs_summary_block *sum_node;
	struct page *sum_page;

	if (curseg->inited)
		write_sum_page(sbi, curseg->sum_blk, GET_SUM_BLOCK(sbi, curseg->segno));

	__set_test_and_inuse(sbi, new_segno);