<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:16:20 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-15205] cfs_hash rehashing can race with hash iteration</title>
                <link>https://jira.whamcloud.com/browse/LU-15205</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;when one thread leaving cfs hash iteration it checks whether it&apos;s time to rehash in cfs_hash_for_each_exit():&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; (bits &amp;gt; 0) {
		cfs_hash_rehash(hs, atomic_read(&amp;amp;hs-&amp;gt;hs_count) &amp;lt;
				    CFS_HASH_LOOP_HOG);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;then cfs_hash_rehash() can start rehashing immediately (not via worker thread):&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; (!do_rehash) {
		&lt;span class=&quot;code-comment&quot;&gt;/* launch and &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; */&lt;/span&gt;
		queue_work(cfs_rehash_wq, &amp;amp;hs-&amp;gt;hs_rehash_work);
		cfs_hash_unlock(hs, 1);
		&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;;
	}

	&lt;span class=&quot;code-comment&quot;&gt;/* rehash right now */&lt;/span&gt;
	cfs_hash_unlock(hs, 1);

	cfs_hash_rehash_worker(&amp;amp;hs-&amp;gt;hs_rehash_work);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;if another thread is starting to iterate the same hash it can find it being rehashed and there is no way to wait for rehashing completion, that works for rehashing in a dedicated thread only:&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; (cfs_hash_is_rehashing(hs))
		cfs_hash_rehash_cancel(hs);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;so 2nd thread just proceed and find hash under rehashing:&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;	LASSERT(!cfs_hash_is_rehashing(hs));&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment></environment>
        <key id="67117">LU-15205</key>
            <summary>cfs_hash rehashing can race with hash iteration</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="wc-triage">WC Triage</assignee>
                                    <reporter username="bzzz">Alex Zhuravlev</reporter>
                        <labels>
                    </labels>
                <created>Wed, 10 Nov 2021 13:12:09 +0000</created>
                <updated>Mon, 15 Nov 2021 06:45:33 +0000</updated>
                            <resolved>Mon, 15 Nov 2021 06:45:33 +0000</resolved>
                                                    <fixVersion>Upstream</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="317834" author="gerrit" created="Wed, 10 Nov 2021 13:17:28 +0000"  >&lt;p&gt;&quot;Alex Zhuravlev &amp;lt;bzzz@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/45516&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/45516&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15205&quot; title=&quot;cfs_hash rehashing can race with hash iteration&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15205&quot;&gt;&lt;del&gt;LU-15205&lt;/del&gt;&lt;/a&gt; libcfs: disable inline rehashing&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 4cfe4a0c5a218399351d8df9bf845e74cd45c5a2&lt;/p&gt;</comment>
                            <comment id="318235" author="bzzz" created="Mon, 15 Nov 2021 06:45:33 +0000"  >&lt;p&gt;will be solved in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15207&quot; title=&quot;ASSERTION( !cfs_hash_is_rehashing(hs)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15207&quot;&gt;&lt;del&gt;LU-15207&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </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|i029kn:</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>