提交 7869e590 编写于 作者: X Xiaowei.Hu 提交者: Linus Torvalds

ocfs2: ocfs2_prep_new_orphaned_file() should return ret

If an error occurs, for example an EIO in __ocfs2_prepare_orphan_dir,
ocfs2_prep_new_orphaned_file will release the inode_ac, then when the
caller of ocfs2_prep_new_orphaned_file gets a 0 return, it will refer to
a NULL ocfs2_alloc_context struct in the following functions.  A kernel
panic happens.
Signed-off-by: N"Xiaowei.Hu" <xiaowei.hu@oracle.com>
Reviewed-by: Nshencanquan <shencanquan@huawei.com>
Acked-by: NSunil Mushran <sunil.mushran@gmail.com>
Cc: Joe Jin <joe.jin@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5402b804
...@@ -2216,7 +2216,7 @@ static int ocfs2_prep_new_orphaned_file(struct inode *dir, ...@@ -2216,7 +2216,7 @@ static int ocfs2_prep_new_orphaned_file(struct inode *dir,
brelse(orphan_dir_bh); brelse(orphan_dir_bh);
return 0; return ret;
} }
int ocfs2_create_inode_in_orphan(struct inode *dir, int ocfs2_create_inode_in_orphan(struct inode *dir,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册