<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:47: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-4969] nodemap key hash comparison is broken</title>
                <link>https://jira.whamcloud.com/browse/LU-4969</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;The key hash comparison function &lt;tt&gt;nodemap_hs_keycmp()&lt;/tt&gt; used for nodemap is broken:&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;static&lt;/span&gt; void *nodemap_hs_key(cfs_hlist_node_t *hnode)
{
        struct lu_nodemap *nodemap;

        nodemap = cfs_hlist_entry(hnode, struct lu_nodemap, nm_hash);

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; nodemap-&amp;gt;nm_name;
}

&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; nodemap_hs_keycmp(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; void *key,
                             cfs_hlist_node_t *compared_hnode)
{
        struct lu_nodemap *nodemap;

        nodemap = nodemap_hs_key(compared_hnode);

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; !strcmp(key, nodemap-&amp;gt;nm_name);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;tt&gt;nodemap_hs_key()&lt;/tt&gt; function returns a pointer to the nodemap name, but then &lt;tt&gt;nodemap_hs_keycmp()&lt;/tt&gt; dereferences this again to try and get the name.&lt;/p&gt;

&lt;p&gt;Since this function is only used when resizing the hash table, it would not be hit until the initial hash table size is getting too full (looks like about 128 entries or so).  I think this could be fixed by just using the return value from &lt;tt&gt;nodemap_hs_key()&lt;/tt&gt; directly:&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;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; nodemap_hs_keycmp(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; void *key,
                             cfs_hlist_node_t *compared_hnode)
{
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; !strcmp(key, nodemap_hs_key(compared_hnode));
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="24433">LU-4969</key>
            <summary>nodemap key hash comparison is broken</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</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="adilger">Andreas Dilger</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Mon, 28 Apr 2014 16:56:00 +0000</created>
                <updated>Tue, 7 Oct 2014 17:30:48 +0000</updated>
                            <resolved>Tue, 7 Oct 2014 17:30:48 +0000</resolved>
                                    <version>Lustre 2.6.0</version>
                                    <fixVersion>Lustre 2.7.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="82633" author="adilger" created="Mon, 28 Apr 2014 16:58:00 +0000"  >&lt;p&gt;Josh, I found this bug while looking at the cfs_hash users in the code.  It is a minor fix but should probably be fixed for 2.6 since it would cause the node to crash.  That said, I don&apos;t think anything but test code will be adding nodemaps yet, so it isn&apos;t a 2.6 blocker.&lt;/p&gt;</comment>
                            <comment id="82740" author="jjw" created="Tue, 29 Apr 2014 14:18:43 +0000"  >&lt;p&gt;Andreas,&lt;/p&gt;

&lt;p&gt;I updated the nodemap hashes to fix the problem and changed the unit test so that it is tested past 128 nodemaps. I also fixed a bug in the idmap tree to fix an insertion/deletion problem.&lt;/p&gt;

&lt;p&gt;The patch is at &lt;a href=&quot;http://review.whamcloud.com/#/c/10147&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/10147&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="95833" author="jlevi" created="Tue, 7 Oct 2014 17:30:48 +0000"  >&lt;p&gt;Patch landed to Master.&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|hzwl93:</customfieldvalue>

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