Commit a4a8481f authored by Guozhonghua's avatar Guozhonghua Committed by Linus Torvalds

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 cf1776a9 ("ocfs2: fix a tiny
race when truncate dio orohaned entry").
Signed-off-by: default avatarGuozhonghua <guozhonghua@h3c.com>
Signed-off-by: default avatarJoseph Qi <joseph.qi@huawei.com>
Reviewed-by: default avatarGang 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5ef11c35
...@@ -956,6 +956,7 @@ static ssize_t ocfs2_direct_IO_write(struct kiocb *iocb, ...@@ -956,6 +956,7 @@ static ssize_t ocfs2_direct_IO_write(struct kiocb *iocb,
tmp_ret = ocfs2_del_inode_from_orphan(osb, inode, di_bh, tmp_ret = ocfs2_del_inode_from_orphan(osb, inode, di_bh,
update_isize, end); update_isize, end);
if (tmp_ret < 0) { if (tmp_ret < 0) {
ocfs2_inode_unlock(inode, 1);
ret = tmp_ret; ret = tmp_ret;
mlog_errno(ret); mlog_errno(ret);
brelse(di_bh); brelse(di_bh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment