<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:14:25 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-14981] ldlm_handle_cp_callback() RETURN() among GOTO(out, ...)s.</title>
                <link>https://jira.whamcloud.com/browse/LU-14981</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;7fff052c930da4822c3b2a13d130da7473a20a58 (&lt;a href=&quot;https://review.whamcloud.com/19898&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/19898&lt;/a&gt; &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7791&quot; title=&quot;signal vs CP callback race&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7791&quot;&gt;&lt;del&gt;LU-7791&lt;/del&gt;&lt;/a&gt; ldlm: signal vs CP callback race) adds to ldlm_handle_cp_callback() a RETURN() among many GOTO(out, ...)s. As a result there is no &lt;tt&gt;wake_up(&amp;amp;lock-&amp;gt;l_waitq)&lt;/tt&gt;.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!ldlm_res_eq(&amp;amp;dlm_req-&amp;gt;lock_desc.l_resource.lr_name,
                         &amp;amp;lock-&amp;gt;l_resource-&amp;gt;lr_name)) {
                ldlm_resource_unlink_lock(lock);
                unlock_res_and_lock(lock);
                rc = ldlm_lock_change_resource(ns, lock,
                                &amp;amp;dlm_req-&amp;gt;lock_desc.l_resource.lr_name);
		&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc &amp;lt; 0) {
                        LDLM_ERROR(lock, &lt;span class=&quot;code-quote&quot;&gt;&quot;Failed to allocate resource&quot;&lt;/span&gt;);
                        GOTO(out, rc);
                }
                LDLM_DEBUG(lock, &lt;span class=&quot;code-quote&quot;&gt;&quot;completion AST, &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; resource&quot;&lt;/span&gt;);
                lock_res_and_lock(lock);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (ldlm_is_failed(lock)) {
		unlock_res_and_lock(lock);
                LDLM_LOCK_RELEASE(lock);
                RETURN(-EINVAL);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (ldlm_is_destroyed(lock) ||
            ldlm_is_granted(lock)) {
                &lt;span class=&quot;code-comment&quot;&gt;/* b=11300: the lock has already been granted */&lt;/span&gt;
                unlock_res_and_lock(lock);
                LDLM_DEBUG(lock, &lt;span class=&quot;code-quote&quot;&gt;&quot;&lt;span class=&quot;code-object&quot;&gt;Double&lt;/span&gt; grant race happened&quot;&lt;/span&gt;);
                GOTO(out, rc = 0);
        }

...
out:
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc &amp;lt; 0) {
                lock_res_and_lock(lock);
		ldlm_set_failed(lock);
                unlock_res_and_lock(lock);
                wake_up(&amp;amp;lock-&amp;gt;l_waitq);
        }
        LDLM_LOCK_RELEASE(lock);

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; 0;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is this correct?&lt;/p&gt;</description>
                <environment></environment>
        <key id="65928">LU-14981</key>
            <summary>ldlm_handle_cp_callback() RETURN() among GOTO(out, ...)s.</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="6" iconUrl="https://jira.whamcloud.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="6">Not a Bug</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Sep 2021 14:11:32 +0000</created>
                <updated>Mon, 18 Oct 2021 12:57:09 +0000</updated>
                            <resolved>Mon, 18 Oct 2021 12:57:09 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="312079" author="green" created="Fri, 3 Sep 2021 16:12:33 +0000"  >&lt;p&gt;This appears to be correct, if you check the out path, we set the failed flag on the lock first and then wake up all others.&lt;/p&gt;

&lt;p&gt;The RETURN call is from the failed check so it came from a racing thread that just set this failed flag and woke us up.&lt;/p&gt;

&lt;p&gt;the only other place that sets the failed flag is in cleanup_resource() when we are cleaning up all resources anyway and it wakes the queue via the call to either completion callback or cancel.&lt;/p&gt;</comment>
                            <comment id="312082" author="green" created="Fri, 3 Sep 2021 16:46:17 +0000"  >&lt;p&gt;Just to clarify, if there&apos;s a desire to insert a wakeup call in that exit path for whatever &quot;just in case&quot; or future-proofing reasons - I&apos;d have no objections to this.&lt;/p&gt;

&lt;p&gt;It&apos;s just after the code inspection I do not see a bug here.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i023hz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>