summaryrefslogtreecommitdiff
path: root/fs/f2fs/inode.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-10-12 19:12:53 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2017-10-26 10:44:14 +0200
commit943973cd528bc8814c85bc3af1c0f8ab87a1d69b (patch)
treebdc0367f536fde11af2566209d20713a80569984 /fs/f2fs/inode.c
parent204b4ae06739ddfe59643c44a205e739938c51e5 (diff)
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 <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inode.c')
-rw-r--r--fs/f2fs/inode.c4
1 files changed, 3 insertions, 1 deletions
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)