<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:26: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-16376] lprocfs_job_stats_log() Invalid jobid size (37), expect(32)</title>
                <link>https://jira.whamcloud.com/browse/LU-16376</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Regular error messages on the console:&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;kernel: LustreError: 8537:0:(lprocfs_jobstats.c:283:lprocfs_job_stats_log()) Invalid jobid size (37), expect(32)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;While this ostensibly seems like the JobID is too large, the problem is that &lt;tt&gt;lprocfs_job_stats_log()&lt;/tt&gt; is only called on the MDS and OSS using the &lt;tt&gt;jobid&lt;/tt&gt; extracted from the RPC in &lt;tt&gt;ptlrpc_body-&amp;gt;pb_jobid&lt;span class=&quot;error&quot;&gt;&amp;#91;32&amp;#93;&lt;/span&gt;&lt;/tt&gt; so it is impossible to be larger than 32 bytes.&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;/* 31 usable bytes string + &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; terminator. */&lt;/span&gt; 
#define LUSTRE_JOBID_SIZE       32

&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; lprocfs_job_stats_log(struct obd_device *obd, &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *jobid,
                          &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; event, &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt; amount)
{
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strlen(jobid) &amp;gt;= LUSTRE_JOBID_SIZE) {
                CERROR(&lt;span class=&quot;code-quote&quot;&gt;&quot;Invalid jobid size (%lu), expect(%d)\n&quot;&lt;/span&gt;,
                       (unsigned &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt;)strlen(jobid) + 1, LUSTRE_JOBID_SIZE);
                RETURN(-EINVAL);
        }
}

void mdt_counter_incr(struct ptlrpc_request *req, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; opcode, &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt; amount)
{
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (exp-&amp;gt;exp_obd &amp;amp;&amp;amp; obd2obt(exp-&amp;gt;exp_obd)-&amp;gt;obt_jobstats.ojs_hash &amp;amp;&amp;amp;
            (exp_connect_flags(exp) &amp;amp; OBD_CONNECT_JOBSTATS))
                lprocfs_job_stats_log(exp-&amp;gt;exp_obd,
                                      lustre_msg_get_jobid(req-&amp;gt;rq_reqmsg),
                                      opcode, amount);
}

&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; inline void ofd_counter_incr(struct obd_export *exp, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; opcode,
                                    &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *jobid, &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt; amount)
{
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (exp-&amp;gt;exp_obd &amp;amp;&amp;amp; obd2obt(exp-&amp;gt;exp_obd)-&amp;gt;obt_jobstats.ojs_hash &amp;amp;&amp;amp;
            (exp_connect_flags(exp) &amp;amp; OBD_CONNECT_JOBSTATS))
                lprocfs_job_stats_log(exp-&amp;gt;exp_obd, jobid, opcode, amount);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;One likely possibility is that &lt;tt&gt;pb_jobid&lt;/tt&gt; is not NUL terminated, and the &lt;tt&gt;strlen()&lt;/tt&gt; overflows into the next bytes in the RPC.&lt;/p&gt;

&lt;p&gt;Rather than repeatedly complain about this and not do anything, it would be better to just NUL terminate the string (as it should be) and then proceed with the truncated JobId&lt;/p&gt;</description>
                <environment></environment>
        <key id="73542">LU-16376</key>
            <summary>lprocfs_job_stats_log() Invalid jobid size (37), expect(32)</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="adilger">Andreas Dilger</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Dec 2022 18:24:42 +0000</created>
                <updated>Wed, 7 Feb 2024 19:27:34 +0000</updated>
                            <resolved>Tue, 20 Dec 2022 14:58:40 +0000</resolved>
                                    <version>Lustre 2.12.8</version>
                    <version>Lustre 2.15.2</version>
                                    <fixVersion>Lustre 2.16.0</fixVersion>
                    <fixVersion>Lustre 2.15.3</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="355757" author="gerrit" created="Thu, 8 Dec 2022 19:58:57 +0000"  >&lt;p&gt;&quot;Andreas Dilger &amp;lt;adilger@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/49351&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/49351&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16376&quot; title=&quot;lprocfs_job_stats_log() Invalid jobid size (37), expect(32)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16376&quot;&gt;&lt;del&gt;LU-16376&lt;/del&gt;&lt;/a&gt; obdclass: NUL terminate log jobid strings&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 754e05e41da401627652bb88571ab101baba590e&lt;/p&gt;</comment>
                            <comment id="356977" author="gerrit" created="Tue, 20 Dec 2022 14:44:08 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/49351/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/49351/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16376&quot; title=&quot;lprocfs_job_stats_log() Invalid jobid size (37), expect(32)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16376&quot;&gt;&lt;del&gt;LU-16376&lt;/del&gt;&lt;/a&gt; obdclass: NUL terminate long jobid strings&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 9eba5d57297f807fddf046356c846478bbf232f4&lt;/p&gt;</comment>
                            <comment id="356986" author="pjones" created="Tue, 20 Dec 2022 14:58:40 +0000"  >&lt;p&gt;Landed for 2.16&lt;/p&gt;</comment>
                            <comment id="357258" author="gerrit" created="Thu, 22 Dec 2022 18:09:32 +0000"  >&lt;p&gt;&quot;Andreas Dilger &amp;lt;adilger@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/49490&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/49490&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16376&quot; title=&quot;lprocfs_job_stats_log() Invalid jobid size (37), expect(32)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16376&quot;&gt;&lt;del&gt;LU-16376&lt;/del&gt;&lt;/a&gt; obdclass: NUL terminate long jobid strings&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_15&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 3ce08283b9a5ea0b50c68874a6acd38b84c23dc6&lt;/p&gt;</comment>
                            <comment id="368978" author="gerrit" created="Tue, 11 Apr 2023 00:06:07 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/49490/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/49490/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16376&quot; title=&quot;lprocfs_job_stats_log() Invalid jobid size (37), expect(32)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16376&quot;&gt;&lt;del&gt;LU-16376&lt;/del&gt;&lt;/a&gt; obdclass: NUL terminate long jobid strings&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_15&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 727638a1d0e72a043c2798f081f166a0e3a39268&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="80702">LU-17512</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="74846">LU-16599</issuekey>
        </issuelink>
                            </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|i037fr:</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>