Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e436403 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: avoid null pointer exception in dcc_info



If dcc_info is not set yet, we can get null pointer panic.

Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 3642582a
Loading
Loading
Loading
Loading
+10 −3
Original line number Original line Diff line number Diff line
@@ -2161,10 +2161,17 @@ static inline bool is_idle(struct f2fs_sb_info *sbi, int type)
		get_pages(sbi, F2FS_RD_META) || get_pages(sbi, F2FS_WB_DATA) ||
		get_pages(sbi, F2FS_RD_META) || get_pages(sbi, F2FS_WB_DATA) ||
		get_pages(sbi, F2FS_WB_CP_DATA) ||
		get_pages(sbi, F2FS_WB_CP_DATA) ||
		get_pages(sbi, F2FS_DIO_READ) ||
		get_pages(sbi, F2FS_DIO_READ) ||
		get_pages(sbi, F2FS_DIO_WRITE) ||
		get_pages(sbi, F2FS_DIO_WRITE))
		atomic_read(&SM_I(sbi)->dcc_info->queued_discard) ||
		return false;

	if (SM_I(sbi) && SM_I(sbi)->dcc_info &&
			atomic_read(&SM_I(sbi)->dcc_info->queued_discard))
		return false;

	if (SM_I(sbi) && SM_I(sbi)->fcc_info &&
			atomic_read(&SM_I(sbi)->fcc_info->queued_flush))
			atomic_read(&SM_I(sbi)->fcc_info->queued_flush))
		return false;
		return false;

	return f2fs_time_over(sbi, type);
	return f2fs_time_over(sbi, type);
}
}