f2fs: avoid stale fi->gdirty_list pointer
Subsystems (2)
Jaegeuk Kim
maintainerPATCH 1/1 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.
--- fs/f2fs/inode.c | 2 ++ 1 file changed, 2 insertions(+)
fs/f2fs/inode.c +2 -0
@@ -535,6 +535,8 @@ void f2fs_evict_inode(struct inode *inode)if (!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)
Signature · 1 line
2.14.0.rc1.383.gd1ce394fe2-goog
Quoted 4 lines · Jaegeuk Kim
When doing fault injection test,
f2fs_evict_inode()didn't removegdirty_listwhich incurs a kernel panic due to wrong pointer access.Signed-off-by Jaegeuk Kim <[email protected]>
Minor thing, how about reverting judgment condition for readability?
if (is_set_ckpt_flags(sbi, CP_ERROR_FLAG))
f2fs_inode_synced() else f2fs_bug_on()
Thanks,
Quoted 18 lines
--- fs/f2fs/inode.c | 2 ++ 1 file changed, 2 insertions(+)fs/f2fs/inode.c +2
-0@@ -535,6 +535,8 @@ void f2fs_evict_inode(struct inode *inode)if (!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)
Jaegeuk Kim
maintainerQuoted 4 lines · Chao Yu
Quoted 3 lines · Jaegeuk Kim
When doing fault injection test,
f2fs_evict_inode()didn't removegdirty_listwhich incurs a kernel panic due to wrong pointer access.
Quoted 8 lines
Quoted 1 line
Signed-off-by Jaegeuk Kim <[email protected]>Reviewed-by Chao Yu <[email protected]>Minor thing, how about reverting judgment condition for readability?
if (
is_set_ckpt_flags(sbi, CP_ERROR_FLAG))f2fs_inode_synced()
We don't need to expect such the errored corner case first. ;)
Quoted 23 lines
else
f2fs_bug_on()Thanks,
Quoted 18 lines
--- fs/f2fs/inode.c | 2 ++ 1 file changed, 2 insertions(+)fs/f2fs/inode.c +2
-0@@ -535,6 +535,8 @@ void f2fs_evict_inode(struct inode *inode)if (!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)
Chao Yu
maintainerQuoted 7 lines · Jaegeuk Kim
Quoted 6 lines · Chao Yu
Quoted 4 lines · Jaegeuk Kim
When doing fault injection test,
f2fs_evict_inode()didn't removegdirty_listwhich incurs a kernel panic due to wrong pointer access.Signed-off-by Jaegeuk Kim <[email protected]>
Quoted 8 lines
Quoted 6 lines
Reviewed-by Chao Yu <[email protected]>Minor thing, how about reverting judgment condition for readability?
if (
is_set_ckpt_flags(sbi, CP_ERROR_FLAG))f2fs_inode_synced()We don't need to expect such the errored corner case first. ;)
Alright, making compiler being aware of this by using {un,}likely? :)
Thanks,
Quoted 33 lines
Quoted 16 lines
else
f2fs_bug_on()Thanks,
Quoted 10 lines
--- fs/f2fs/inode.c | 2 ++ 1 file changed, 2 insertions(+)fs/f2fs/inode.c +0
-0@@ -535,6 +535,8 @@ void f2fs_evict_inode(struct inode *inode)Quoted 8 lines
fs/f2fs/inode.c void f2fs_evict_inode(struct inode *inode) · line 542
Quoted 8 lines
fs/f2fs/inode.c +2
-0if (!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)------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Jaegeuk Kim
maintainerQuoted 10 lines · Chao Yu
Quoted 9 lines · Jaegeuk Kim
Quoted 8 lines · Chao Yu
Quoted 4 lines · Jaegeuk Kim
When doing fault injection test,
f2fs_evict_inode()didn't removegdirty_listwhich incurs a kernel panic due to wrong pointer access.Signed-off-by Jaegeuk Kim <[email protected]>Reviewed-by Chao Yu <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Minor thing, how about reverting judgment condition for readability?
if (
is_set_ckpt_flags(sbi, CP_ERROR_FLAG))f2fs_inode_synced()We don't need to expect such the errored corner case first. ;)
Alright, making compiler being aware of this by using {un,}likely? :)
Yup, added. ;)
Quoted 36 lines
Thanks,
Quoted 33 lines
Quoted 16 lines
else
f2fs_bug_on()Thanks,
Quoted 10 lines
--- fs/f2fs/inode.c | 2 ++ 1 file changed, 2 insertions(+)fs/f2fs/inode.c +0
-0@@ -535,6 +535,8 @@ void f2fs_evict_inode(struct inode *inode)Quoted 8 lines
fs/f2fs/inode.c void f2fs_evict_inode(struct inode *inode) · line 542
Quoted 8 lines
fs/f2fs/inode.c +2
-0if (!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)------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel