ocfs2: ocfs2_prep_new_orphaned_file() should return ret
authorXiaowei.Hu <xiaowei.hu@oracle.com>
Wed, 12 Jun 2013 21:04:41 +0000 (14:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Jun 2013 23:29:44 +0000 (16:29 -0700)
commit7869e590679ed71cd1a1e676e8c1c179762c3efe
treee94ea4a98ccd296ca9209694ccab937ecb780c4e
parent5402b8047b0d286b6501f9097891cbf1e06daa3a
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>
fs/ocfs2/namei.c