<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">&lt;<a href="mailto:akpm@linux-foundation.org" target="_blank">akpm@linux-foundation.org</a>&gt;</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 &lt;<a href="mailto:joseph.qi@huawei.com">joseph.qi@huawei.com</a>&gt; wrote:<br>

<br>
&gt; In ocfs2_file_aio_write, it does ocfs2_rw_lock first and then<br>
&gt; ocfs2_inode_lock. But if ocfs2_inode_lock failed, it goes to out_sems<br>
&gt; without unlocking rw lock. This will cause a bug in ocfs2_lock_res_free<br>
&gt; when testing res-&gt;l_ex_holders, which is increased in<br>
&gt; __ocfs2_cluster_lock and decreased in __ocfs2_cluster_unlock.<br>
&gt;<br>
</div>&gt; ...<br>
<div class="im">&gt;<br>
&gt; --- a/fs/ocfs2/file.c<br>
&gt; +++ b/fs/ocfs2/file.c<br>
&gt; @@ -2290,7 +2290,7 @@ relock:<br>
&gt;               ret = ocfs2_inode_lock(inode, NULL, 1);<br>
&gt;               if (ret &lt; 0) {<br>
&gt;                       mlog_errno(ret);<br>
&gt; -                     goto out_sems;<br>
&gt; +                     goto out;<br>
&gt;               }<br>
&gt;<br>
&gt;               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&#39;m trying to work out which kernel versions we should merge the<br>
fix into, but the changelog didn&#39;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>