<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:39:29 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-4081] mdc_enqueue() may return a freed lock in intent</title>
                <link>https://jira.whamcloud.com/browse/LU-4081</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;This is the sister bug to &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-4079&quot; title=&quot;ll_revalidate_it() may access request after releasing intent&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-4079&quot;&gt;&lt;del&gt;LU-4079&lt;/del&gt;&lt;/a&gt;. Any failure in mdc_finish_enqueue() after the lock handle is copied over to the intent will cause mdc_enqueue() to drop its reference to the lock but return it in the intent anyway. The lock cookie returned through the lockh param is 0. There are several allocations that could fail in mdc_finish_enqueue() but I just added a fail check for simplicity.&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;mdc_finish_enqueue()
{
        ...
        intent-&amp;gt;it_disposition = (int)lockrep-&amp;gt;lock_policy_res1;
        intent-&amp;gt;it_status = (int)lockrep-&amp;gt;lock_policy_res2;
        intent-&amp;gt;it_lock_mode = einfo-&amp;gt;ei_mode;
        intent-&amp;gt;it_lock_handle = lockh-&amp;gt;cookie;
        intent-&amp;gt;it_data = req;

        ...

        DEBUG_REQ(D_RPCTRACE, req, &quot;op: %d disposition: %x, status: %d&quot;,
                  it-&amp;gt;it_op, intent-&amp;gt;it_disposition, intent-&amp;gt;it_status);

+       if (OBD_FAIL_CHECK(0x3000))
+               RETURN(-EPROTO);
+
        ...
}

mdc_enqueue()
{
        ...
        rc = mdc_finish_enqueue(exp, req, einfo, it, lockh, rc);
        if (rc &amp;lt; 0) {
                if (lustre_handle_is_used(lockh)) {
                        ldlm_lock_decref(lockh, einfo-&amp;gt;ei_mode);
                        memset(lockh, 0, sizeof(*lockh));
                }
                ptlrpc_req_finished(req);
        }
        RETURN(rc);
}

# llmount.sh
# sh ./lustre/tests/racer.sh
...
== racer test 1: racer on clients: t DURATION=300 == 15:04:21 (1381349061)
racers pids: 28220 28221
...
# lctl set_param fail_loc=0x3000

Lustre: *** cfs_fail_loc=3000, val=0***
LustreError: 31331:0:(ldlm_lock.c:851:ldlm_lock_decref_internal_nolock()) ASSERTION( lock\
-&amp;gt;l_readers &amp;gt; 0 ) failed:
LustreError: 31331:0:(ldlm_lock.c:851:ldlm_lock_decref_internal_nolock()) LBUG
Pid: 31331, comm: mkdir

Call Trace:
 [&amp;lt;ffffffffa0d95895&amp;gt;] libcfs_debug_dumpstack+0x55/0x80 [libcfs]
 [&amp;lt;ffffffffa0d95e97&amp;gt;] lbug_with_loc+0x47/0xb0 [libcfs]
 [&amp;lt;ffffffffa10167f2&amp;gt;] ldlm_lock_decref_internal_nolock+0xd2/0x180 [ptlrpc]
 [&amp;lt;ffffffffa101aabd&amp;gt;] ldlm_lock_decref_internal+0x4d/0xad0 [ptlrpc]
 [&amp;lt;ffffffffa0eb6ae5&amp;gt;] ? class_handle2object+0x95/0x190 [obdclass]
 [&amp;lt;ffffffffa101bf79&amp;gt;] ldlm_lock_decref+0x39/0x90 [ptlrpc]
 [&amp;lt;ffffffffa073bd2f&amp;gt;] ll_intent_drop_lock+0xaf/0x150 [lustre]
 [&amp;lt;ffffffffa07716cb&amp;gt;] ? ll_finish_md_op_data+0x2cb/0x410 [lustre]
 [&amp;lt;ffffffffa073e5a8&amp;gt;] ll_revalidate_it+0xbe8/0x1b20 [lustre]
 [&amp;lt;ffffffffa0786940&amp;gt;] ? ll_md_blocking_ast+0x0/0x790 [lustre]
 [&amp;lt;ffffffffa0786940&amp;gt;] ? ll_md_blocking_ast+0x0/0x790 [lustre]
 [&amp;lt;ffffffffa073f613&amp;gt;] ll_revalidate_nd+0x133/0x3e0 [lustre]
 [&amp;lt;ffffffff8118fa45&amp;gt;] __lookup_hash+0x85/0x160
 [&amp;lt;ffffffff8119016a&amp;gt;] lookup_hash+0x3a/0x50
 [&amp;lt;ffffffff811901ee&amp;gt;] lookup_create+0x6e/0xd0
 [&amp;lt;ffffffff81193aac&amp;gt;] sys_mkdirat+0x7c/0x130
 [&amp;lt;ffffffff811a36d0&amp;gt;] ? mntput_no_expire+0x30/0x110
 [&amp;lt;ffffffff811a36d0&amp;gt;] ? mntput_no_expire+0x30/0x110
 [&amp;lt;ffffffff81193b78&amp;gt;] sys_mkdir+0x18/0x20
 [&amp;lt;ffffffff8100b072&amp;gt;] system_call_fastpath+0x16/0x1b
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="21334">LU-4081</key>
            <summary>mdc_enqueue() may return a freed lock in intent</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="3">Duplicate</resolution>
                                        <assignee username="dmiter">Dmitry Eremin</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                            <label>mdc</label>
                    </labels>
                <created>Wed, 9 Oct 2013 20:17:42 +0000</created>
                <updated>Thu, 3 Jul 2014 16:20:46 +0000</updated>
                            <resolved>Thu, 3 Jul 2014 16:20:32 +0000</resolved>
                                    <version>Lustre 2.5.0</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="88110" author="jhammond" created="Thu, 3 Jul 2014 16:20:32 +0000"  >&lt;p&gt;Fixing this in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5289&quot; title=&quot;mdc_enqueue() may leave an invalid lock handle in intent&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5289&quot;&gt;&lt;del&gt;LU-5289&lt;/del&gt;&lt;/a&gt;.&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|hzw58n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>10963</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>