<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:40:28 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-4189] Strange code in mdc_changelog_send_thread</title>
                <link>https://jira.whamcloud.com/browse/LU-4189</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Playing with the stack tool, it uncovered this strange piece in mdc_changelog_send_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-comment&quot;&gt;/* Send EOF no matter what our result */&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ((kuch = changelog_kuc_hdr(cs-&amp;gt;cs_buf, sizeof(*kuch),
                                      cs-&amp;gt;cs_flags))) {
                kuch-&amp;gt;kuc_msgtype = CL_EOF;
                libcfs_kkuc_msg_put(cs-&amp;gt;cs_fp, kuch);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, the thing is that changelog_kuc_hdr never returns NULL as we pass the pointer into it already and if it&apos;s zero, we&apos;d totally die before even returning:&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 kuc_hdr *changelog_kuc_hdr(&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *buf, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; len, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; flags)
{
        struct kuc_hdr *lh = (struct kuc_hdr *)buf;

        LASSERT(len &amp;lt;= KUC_CHANGELOG_MSG_MAXSIZE);

        lh-&amp;gt;kuc_magic = KUC_MAGIC;
        lh-&amp;gt;kuc_transport = KUC_TRANSPORT_CHANGELOG;
        lh-&amp;gt;kuc_flags = flags;
        lh-&amp;gt;kuc_msgtype = CL_RECORD;
        lh-&amp;gt;kuc_msglen = len;
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; lh;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So I guess weeither should do away with the if here and make for a more readable code, or actually insert some checks into changelog_kuc_hdr&lt;/p&gt;</description>
                <environment></environment>
        <key id="21725">LU-4189</key>
            <summary>Strange code in mdc_changelog_send_thread</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="wc-triage">WC Triage</assignee>
                                    <reporter username="green">Oleg Drokin</reporter>
                        <labels>
                            <label>easy</label>
                            <label>patch</label>
                    </labels>
                <created>Wed, 30 Oct 2013 03:05:29 +0000</created>
                <updated>Tue, 7 Jul 2015 00:03:55 +0000</updated>
                            <resolved>Tue, 7 Jul 2015 00:03:55 +0000</resolved>
                                    <version>Lustre 2.6.0</version>
                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="100553" author="gerrit" created="Wed, 3 Dec 2014 14:08:22 +0000"  >&lt;p&gt;Henri Doreau (henri.doreau@cea.fr) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/12919&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/12919&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-4189&quot; title=&quot;Strange code in mdc_changelog_send_thread&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-4189&quot;&gt;&lt;del&gt;LU-4189&lt;/del&gt;&lt;/a&gt; mdc: Removed unneeded NULL check&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: ff9653d1ab1c9921520205a43b2797cfdf11fe2a&lt;/p&gt;</comment>
                            <comment id="104430" author="hdoreau" created="Thu, 22 Jan 2015 23:01:04 +0000"  >&lt;p&gt;I have posted a patch to clean that on &lt;a href=&quot;http://review.whamcloud.com/#/c/12919/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/12919/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Could someone have a look? I&apos;m not sure who to add as reviewer.&lt;/p&gt;</comment>
                            <comment id="113629" author="gerrit" created="Tue, 28 Apr 2015 15:42:01 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/12919/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/12919/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-4189&quot; title=&quot;Strange code in mdc_changelog_send_thread&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-4189&quot;&gt;&lt;del&gt;LU-4189&lt;/del&gt;&lt;/a&gt; mdc: Removed unneeded NULL check&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 83fedb85505f2da7d34f7140e170ba52759e705b&lt;/p&gt;</comment>
                            <comment id="120507" author="pjones" created="Tue, 7 Jul 2015 00:03:55 +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 ">
                                        <issuelink>
            <issuekey id="17451">LU-2753</issuekey>
        </issuelink>
                            </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|hzw7bb:</customfieldvalue>

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