<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:47:16 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-11827] Race between llog_cat_declare_add_rec and llog_cat_current_log</title>
                <link>https://jira.whamcloud.com/browse/LU-11827</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;llog_cat_declare_add_rec() operates on &amp;amp;cathandle-&amp;gt;u.chd.chd_next_log without having it protected:&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-object&quot;&gt;int&lt;/span&gt; llog_cat_declare_add_rec(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_env *env,
...
        rc = llog_cat_prep_log(env, cathandle,
                               &amp;amp;cathandle-&amp;gt;u.chd.chd_current_log, th);
...
	rc = llog_cat_prep_log(env, cathandle, &amp;amp;cathandle-&amp;gt;u.chd.chd_next_log,
                               th);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;That races with llog_cat_current_log() when it switches to next log and updates cathandle-&amp;gt;u.chd.chd_next_log:&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; struct llog_handle *llog_cat_current_log(struct llog_handle *cathandle,
...
        down_write_nested(&amp;amp;cathandle-&amp;gt;lgh_lock, LLOGH_CAT);
...
        CDEBUG(D_INODE, &lt;span class=&quot;code-quote&quot;&gt;&quot;use next log\n&quot;&lt;/span&gt;);
 
        loghandle = cathandle-&amp;gt;u.chd.chd_next_log;
        cathandle-&amp;gt;u.chd.chd_current_log = loghandle;
        cathandle-&amp;gt;u.chd.chd_next_log = NULL;
        down_write_nested(&amp;amp;loghandle-&amp;gt;lgh_lock, LLOGH_LOG);
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The following trace has been observed:&lt;br/&gt;
Process 177713 enters llog_cat_declare_add_rec():&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;00000040:00000001:19.0:1545138333.143874:0:177713:0:(llog_cat.c:605:llog_cat_declare_add_rec()) Process entered
00000040:00000001:19.0:1545138333.143875:0:177713:0:(llog.c:940:llog_exist()) Process leaving (rc=1 : 1 : 1)
00000040:00000001:19.0:1545138333.143876:0:177713:0:(llog.c:940:llog_exist()) Process leaving (rc=0 : 0 : 0)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Process 99986 jumps in and switches pointer to next log in cathalog handle to NULL:&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;00000040:00000002:21.0:1545138333.143876:0:99986:0:(llog_cat.c:521:llog_cat_current_log()) use next log
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Process 177713 continues: llog_cat_prep_log&amp;#45;&amp;gt;llog_declare_create&amp;#45;&amp;gt;llog_handle2ops, find NULL in and fails in llog_handle2ops() with -22 as long as *ploghandle is NULL:&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;00000040:00000001:19.0:1545138333.143877:0:177713:0:(llog.c:954:llog_declare_create()) Process leaving (rc=18446744073709551594 : -22 : ffffffffffffffea)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</description>
                <environment></environment>
        <key id="54399">LU-11827</key>
            <summary>Race between llog_cat_declare_add_rec and llog_cat_current_log</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="laisiyao">Lai Siyao</assignee>
                                    <reporter username="vsaveliev">Vladimir Saveliev</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Dec 2018 15:08:07 +0000</created>
                <updated>Mon, 1 Apr 2019 14:16:11 +0000</updated>
                            <resolved>Wed, 27 Feb 2019 05:31:13 +0000</resolved>
                                                    <fixVersion>Lustre 2.13.0</fixVersion>
                    <fixVersion>Lustre 2.12.1</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>8</watches>
                                                                            <comments>
                            <comment id="239107" author="gerrit" created="Mon, 24 Dec 2018 15:22:57 +0000"  >&lt;p&gt;Vladimir Saveliev (c17830@cray.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/33914&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/33914&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11827&quot; title=&quot;Race between llog_cat_declare_add_rec and llog_cat_current_log&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11827&quot;&gt;&lt;del&gt;LU-11827&lt;/del&gt;&lt;/a&gt; llog: protect cathandle in llog_cat_declare_add_rec&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 052bfbd11bad6a04821a99ba60094b55cab38ab6&lt;/p&gt;</comment>
                            <comment id="242657" author="green" created="Mon, 25 Feb 2019 09:42:36 +0000"  >&lt;p&gt;Please see a somewhat related failure scenario in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12008&quot; title=&quot;Accessing freed semaphore in llog_cat_add_rec after error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12008&quot;&gt;LU-12008&lt;/a&gt;, do you think this will help there too?&lt;/p&gt;</comment>
                            <comment id="242890" author="gerrit" created="Wed, 27 Feb 2019 02:02:00 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/33914/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/33914/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11827&quot; title=&quot;Race between llog_cat_declare_add_rec and llog_cat_current_log&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11827&quot;&gt;&lt;del&gt;LU-11827&lt;/del&gt;&lt;/a&gt; llog: protect cathandle in llog_cat_declare_add_rec&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 59a62ada2e18174e5611730e8bcf5ba3165ca2b9&lt;/p&gt;</comment>
                            <comment id="242918" author="pjones" created="Wed, 27 Feb 2019 05:31:13 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                            <comment id="243071" author="pfarrell" created="Thu, 28 Feb 2019 20:00:53 +0000"  >&lt;p&gt;Looks like this was hit on 2.12.0 by a customer:&lt;br/&gt;
&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11984&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.whamcloud.com/browse/LU-11984&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="244245" author="gerrit" created="Tue, 19 Mar 2019 17:26:06 +0000"  >&lt;p&gt;Minh Diep (mdiep@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/34455&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/34455&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11827&quot; title=&quot;Race between llog_cat_declare_add_rec and llog_cat_current_log&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11827&quot;&gt;&lt;del&gt;LU-11827&lt;/del&gt;&lt;/a&gt; llog: protect cathandle in llog_cat_declare_add_rec&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 8fe07060d1dce0813ca92178d2e2541e43e99f20&lt;/p&gt;</comment>
                            <comment id="244982" author="gerrit" created="Mon, 1 Apr 2019 06:20:16 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/34455/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/34455/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11827&quot; title=&quot;Race between llog_cat_declare_add_rec and llog_cat_current_log&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11827&quot;&gt;&lt;del&gt;LU-11827&lt;/del&gt;&lt;/a&gt; llog: protect cathandle in llog_cat_declare_add_rec&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 834d54138b250ddedc06f478e9cdfdbf0c352bda&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="54939">LU-11984</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <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|i008of:</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>