diff options
author | Xiaowei.Hu <xiaowei.hu@oracle.com> | 2013-06-12 17:04:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-12 19:29:44 -0400 |
commit | 7869e590679ed71cd1a1e676e8c1c179762c3efe (patch) | |
tree | e94ea4a98ccd296ca9209694ccab937ecb780c4e | |
parent | 5402b8047b0d286b6501f9097891cbf1e06daa3a (diff) |
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: "Xiaowei.Hu" <xiaowei.hu@oracle.com>
Reviewed-by: shencanquan <shencanquan@huawei.com>
Acked-by: Sunil 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/ocfs2/namei.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 04ee1b57c243..b563351753f1 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -2216,7 +2216,7 @@ out: | |||
2216 | 2216 | ||
2217 | brelse(orphan_dir_bh); | 2217 | brelse(orphan_dir_bh); |
2218 | 2218 | ||
2219 | return 0; | 2219 | return ret; |
2220 | } | 2220 | } |
2221 | 2221 | ||
2222 | int ocfs2_create_inode_in_orphan(struct inode *dir, | 2222 | int ocfs2_create_inode_in_orphan(struct inode *dir, |