<div dir="ltr">It should almost never trigger. ocfs2_inode_lock() should always succeed and<br>only return after it has gotten the required lock.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 8, 2013 at 12:38 PM, Andrew Morton <span dir="ltr"><<a href="mailto:akpm@linux-foundation.org" target="_blank">akpm@linux-foundation.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, 6 May 2013 22:43:39 +0800 Joseph Qi <<a href="mailto:joseph.qi@huawei.com">joseph.qi@huawei.com</a>> wrote:<br>
<br>
> In ocfs2_file_aio_write, it does ocfs2_rw_lock first and then<br>
> ocfs2_inode_lock. But if ocfs2_inode_lock failed, it goes to out_sems<br>
> without unlocking rw lock. This will cause a bug in ocfs2_lock_res_free<br>
> when testing res->l_ex_holders, which is increased in<br>
> __ocfs2_cluster_lock and decreased in __ocfs2_cluster_unlock.<br>
><br>
</div>> ...<br>
<div class="im">><br>
> --- a/fs/ocfs2/file.c<br>
> +++ b/fs/ocfs2/file.c<br>
> @@ -2290,7 +2290,7 @@ relock:<br>
> ret = ocfs2_inode_lock(inode, NULL, 1);<br>
> if (ret < 0) {<br>
> mlog_errno(ret);<br>
> - goto out_sems;<br>
> + goto out;<br>
> }<br>
><br>
> ocfs2_inode_unlock(inode, 1);<br>
<br>
</div>That seems like a fairly serious bug. How long has it been there and<br>
what userspace actions are required to trigger it?<br>
<br>
(I'm trying to work out which kernel versions we should merge the<br>
fix into, but the changelog didn't give me enough info to determine<br>
this)<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Ocfs2-devel mailing list<br>
<a href="mailto:Ocfs2-devel@oss.oracle.com">Ocfs2-devel@oss.oracle.com</a><br>
<a href="https://oss.oracle.com/mailman/listinfo/ocfs2-devel" target="_blank">https://oss.oracle.com/mailman/listinfo/ocfs2-devel</a><br>
</div></div></blockquote></div><br></div>