Commit 3c68c336 authored by Guozhonghua's avatar Guozhonghua Committed by Kamal Mostafa

ocfs2: unlock inode if deleting inode from orphan fails

commit a4a8481f upstream.

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>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 5280cee0
...@@ -934,6 +934,7 @@ static ssize_t ocfs2_direct_IO_write(struct kiocb *iocb, ...@@ -934,6 +934,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);
goto out; goto out;
......
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