<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:00:53 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-6516] double spin unlock in ofd_inconsistency_verification_main</title>
                <link>https://jira.whamcloud.com/browse/LU-6516</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;found by smatch, in ofd_inconsistency_verification_main:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;        spin_unlock(&amp;amp;ofd-&amp;gt;ofd_inconsistency_lock);
        if (rc != 0)
                RETURN(rc);

        OBD_ALLOC_PTR(lr);
        if (unlikely(lr == NULL))
                GOTO(out, rc = -ENOMEM);
...
        thread_set_flags(thread, SVC_STOPPED);
        wake_up_all(&amp;amp;thread-&amp;gt;t_ctl_waitq);
        spin_unlock(&amp;amp;ofd-&amp;gt;ofd_inconsistency_lock);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="29707">LU-6516</key>
            <summary>double spin unlock in ofd_inconsistency_verification_main</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="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="yujian">Jian Yu</assignee>
                                    <reporter username="green">Oleg Drokin</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Mon, 27 Apr 2015 04:40:47 +0000</created>
                <updated>Tue, 29 Dec 2015 21:53:51 +0000</updated>
                            <resolved>Tue, 18 Aug 2015 13:57:42 +0000</resolved>
                                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="115640" author="uvaze" created="Mon, 18 May 2015 10:14:54 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Yes this seems to be issue. Earlier we are taking   lock and waking  up threads.&lt;br/&gt;
See this code -&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;spin_lock(&amp;amp;ofd-&amp;gt;ofd_inconsistency_lock);
    thread_set_flags(thread, rc != 0 ? SVC_STOPPED : SVC_RUNNING);
    wake_up_all(&amp;amp;thread-&amp;gt;t_ctl_waitq);
    spin_unlock(&amp;amp;ofd-&amp;gt;ofd_inconsistency_lock);
 &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However in out   we did not lock again.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;thread_set_flags(thread, SVC_STOPPED);
    wake_up_all(&amp;amp;thread-&amp;gt;t_ctl_waitq);
    spin_unlock(&amp;amp;ofd-&amp;gt;ofd_inconsistency_lock);
    lu_env_fini(&amp;amp;env);

    return rc;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is because in normal case  we have spinlock already taken.&lt;br/&gt;
But if memory allocation failed then this will not work.&lt;br/&gt;
Probable solution is -&lt;br/&gt;
OBD_ALLOC_PTR(lr);&lt;br/&gt;
    if (unlikely(lr == NULL))&lt;br/&gt;
        GOTO(out1, rc = &lt;del&gt;ENOMEM);&amp;lt;&lt;/del&gt;--- added new lable&lt;/p&gt;

&lt;p&gt;out1:&lt;br/&gt;
 spin_lock(&amp;amp;ofd-&amp;gt;ofd_inconsistency_lock);&lt;br/&gt;
    thread_set_flags(thread, rc != 0 ? SVC_STOPPED : SVC_RUNNING);&lt;br/&gt;
    wake_up_all(&amp;amp;thread-&amp;gt;t_ctl_waitq);&lt;br/&gt;
    spin_unlock(&amp;amp;ofd-&amp;gt;ofd_inconsistency_lock);&lt;br/&gt;
    lu_env_fini(&amp;amp;env);&lt;/p&gt;

&lt;p&gt;    return rc;&lt;/p&gt;


&lt;p&gt;Please advice.&lt;br/&gt;
-Ulka&lt;/p&gt;

</comment>
                            <comment id="115990" author="gerrit" created="Wed, 20 May 2015 10:37:16 +0000"  >&lt;p&gt;Ulka Vaze (ulka.vaze@yahoo.in) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/14875&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14875&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6516&quot; title=&quot;double spin unlock in ofd_inconsistency_verification_main&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6516&quot;&gt;&lt;del&gt;LU-6516&lt;/del&gt;&lt;/a&gt; ofd: double unlock of spinlock&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 1095e21567f7cfb5906d9e7178e950567fb924a4&lt;/p&gt;</comment>
                            <comment id="124395" author="gerrit" created="Tue, 18 Aug 2015 11:26:49 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/14875/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14875/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6516&quot; title=&quot;double spin unlock in ofd_inconsistency_verification_main&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6516&quot;&gt;&lt;del&gt;LU-6516&lt;/del&gt;&lt;/a&gt; ofd: fix double spin_unlock&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 490ea83a486c0c44274f4d4f6f77d8e0e16835d5&lt;/p&gt;</comment>
                            <comment id="124413" author="pjones" created="Tue, 18 Aug 2015 13:57:42 +0000"  >&lt;p&gt;Landed for 2.8&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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|hzxbqn:</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>