From: Jaegeuk Kim Date: Fri, 13 Oct 2017 02:12:53 +0000 (-0700) Subject: f2fs: avoid stale fi->gdirty_list pointer X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2f18884d3c65b1fe4c12c783754e56d67dc750ea;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git f2fs: avoid stale fi->gdirty_list pointer When doing fault injection test, f2fs_evict_inode() didn't remove gdirty_list which incurs a kernel panic due to wrong pointer access. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index ad4f7d52c0ad..3617e7fca930 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -520,8 +520,10 @@ no_delete: stat_dec_inline_dir(inode); stat_dec_inline_inode(inode); - if (!is_set_ckpt_flags(sbi, CP_ERROR_FLAG)) + if (likely(!is_set_ckpt_flags(sbi, CP_ERROR_FLAG))) f2fs_bug_on(sbi, is_inode_flag_set(inode, FI_DIRTY_INODE)); + else + f2fs_inode_synced(inode); /* ino == 0, if f2fs_new_inode() was failed t*/ if (inode->i_ino)