aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorGuozhonghua <guozhonghua@h3c.com>2016-02-26 18:19:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-02-27 13:28:52 -0500
commita4a8481ff68a8a324a878e281bc37f18665224f7 (patch)
tree0a7465c913bb96534a4a2ab5d3ac4c6587f86e56 /fs
parent5ef11c35ce86b94bfb878b684de4cdaf96f54b2f (diff)
ocfs2: unlock inode if deleting inode from orphan fails
When doing append direct io cleanup, if deleting inode fails, it goes out without unlocking inode, which will cause the inode deadlock. This issue was introduced by commit cf1776a9e834 ("ocfs2: fix a tiny race when truncate dio orohaned entry"). Signed-off-by: Guozhonghua <guozhonghua@h3c.com> Signed-off-by: Joseph Qi <joseph.qi@huawei.com> Reviewed-by: Gang He <ghe@suse.com> Cc: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: <stable@vger.kernel.org> [4.2+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/aops.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 794fd1587f34..cda0361e95a4 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -956,6 +956,7 @@ clean_orphan:
956 tmp_ret = ocfs2_del_inode_from_orphan(osb, inode, di_bh, 956 tmp_ret = ocfs2_del_inode_from_orphan(osb, inode, di_bh,
957 update_isize, end); 957 update_isize, end);
958 if (tmp_ret < 0) { 958 if (tmp_ret < 0) {
959 ocfs2_inode_unlock(inode, 1);
959 ret = tmp_ret; 960 ret = tmp_ret;
960 mlog_errno(ret); 961 mlog_errno(ret);
961 brelse(di_bh); 962 brelse(di_bh);