<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:35:15 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-17414] liblnetconfig printing bogus error numbers for users</title>
                <link>https://jira.whamcloud.com/browse/LU-17414</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;I was lead to looking at &lt;tt&gt;lustre_lnet_config_ni()&lt;/tt&gt;, and found that it is returning somewhat &quot;random&quot; error codes to the user and then &lt;tt&gt;lnetctl&lt;/tt&gt; is printing them like &quot;&lt;tt&gt;errno: -1&lt;/tt&gt;&quot;.  However, it turns out that &quot;&lt;tt&gt;&amp;#45;1&lt;/tt&gt;&quot; is not the POSIX error code &quot;&lt;tt&gt;&amp;#45;EPERM&lt;/tt&gt;&quot; as one might expect, but rather &quot;&lt;tt&gt;LUSTRE_CFG_RC_BAD_PARAM&lt;/tt&gt;&quot;, which is IMHO very confusing.&lt;/p&gt;

&lt;p&gt;Also, &lt;tt&gt;lustre_lnet_config_ni()&lt;/tt&gt; is also returning POSIX error codes from the &lt;tt&gt;l_ioctl()&lt;/tt&gt; call in the function, so it is impossible to know which error type is actually being returned.&lt;/p&gt;

&lt;p&gt;This code should be changed to use existing POSIX error numbers that have similar meanings, or could at least fill the same role (with some creative mapping):&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;
    #define LUSTRE_CFG_RC_NO_ERR                     0  =&amp;gt; fine
    #define LUSTRE_CFG_RC_BAD_PARAM                 -1  =&amp;gt; -EINVAL
    #define LUSTRE_CFG_RC_MISSING_PARAM             -2  =&amp;gt; -EFAULT
    #define LUSTRE_CFG_RC_OUT_OF_RANGE_PARAM        -3  =&amp;gt; -ERANGE
    #define LUSTRE_CFG_RC_OUT_OF_MEM                -4  =&amp;gt; -ENOMEM
    #define LUSTRE_CFG_RC_GENERIC_ERR               -5  =&amp;gt; -ENODATA
    #define LUSTRE_CFG_RC_NO_MATCH                  -6  =&amp;gt; -ENOMSG
    #define LUSTRE_CFG_RC_MATCH                     -7  =&amp;gt; -EXFULL
    #define LUSTRE_CFG_RC_SKIP                      -8  =&amp;gt; -EBADSLT
    #define LUSTRE_CFG_RC_LAST_ELEM                 -9  =&amp;gt; -ECHRNG
    #define LUSTRE_CFG_RC_MARSHAL_FAIL              -10 =&amp;gt; -ENOSTR
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I don&apos;t think &quot;overloading&quot; the POSIX error codes to mean something similar is worse than using random numbers to report errors.&lt;/p&gt;

&lt;p&gt;It looks like these error definitions are only in userspace, but I&apos;m not 100% sure.  The vast majority of &lt;tt&gt;LUSTRE_CFG_RC_&amp;#42;&lt;/tt&gt; errors are only used inside &lt;tt&gt;liblnetconfig&lt;/tt&gt;, so changing them won&apos;t affect the library at all.&lt;/p&gt;

&lt;p&gt;The only other place these error values are used are in &lt;tt&gt;lnetctl.c&lt;/tt&gt;, which mostly only checking &quot;&lt;tt&gt;!= LUSTRE_CFG_RC_NO_ERR&lt;/tt&gt;&quot;, this should be relatively safe to change, and &lt;tt&gt;lustre/tests/lutf/python/&lt;/tt&gt; which should also be OK to change I &lt;em&gt;think&lt;/em&gt; (as long as the error codes from one node are not interpreted by &lt;tt&gt;lnetctl&lt;/tt&gt; on another node). &lt;/p&gt;

&lt;p&gt;If binary compatibility is needed, it looks like none of the values currently overlap, so it would be possible to check both the old and new values for the return in the few places that are not checking &lt;tt&gt;LUSTRE_CFG_RC_NO_ERR&lt;/tt&gt;, and then at some point in the future start actually returning them...&lt;/p&gt;</description>
                <environment></environment>
        <key id="79937">LU-17414</key>
            <summary>liblnetconfig printing bogus error numbers for users</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="arshad512">Arshad Hussain</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Thu, 11 Jan 2024 05:05:09 +0000</created>
                <updated>Sun, 4 Feb 2024 14:47:43 +0000</updated>
                            <resolved>Sun, 4 Feb 2024 14:47:43 +0000</resolved>
                                    <version>Lustre 2.10.0</version>
                    <version>Lustre 2.14.0</version>
                    <version>Lustre 2.16.0</version>
                    <version>Lustre 2.12.9</version>
                    <version>Lustre 2.15.0</version>
                                    <fixVersion>Lustre 2.16.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>7</watches>
                                                                            <comments>
                            <comment id="399245" author="adilger" created="Thu, 11 Jan 2024 05:13:40 +0000"  >&lt;p&gt;The only places outside of &lt;tt&gt;liblnetconfig&lt;/tt&gt; that are not using &lt;tt&gt;LUSTRE_CFG_RC_NO_ERR&lt;/tt&gt; are:&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;lnet/utils/lnetctl.c:2331:				rc = LUSTRE_CFG_RC_BAD_PARAM;
lnet/utils/lnetctl.c:3971:				rc = LUSTRE_CFG_RC_BAD_PARAM;
lnet/utils/lnetctl.c:3980:				rc = LUSTRE_CFG_RC_BAD_PARAM;
lnet/utils/lnetctl.c:3989:				rc = LUSTRE_CFG_RC_BAD_PARAM;
lustre/tests/lutf/python/tests-infra/lnet_helpers.py:294:	if (rc == lnetconfig.LUSTRE_CFG_RC_MISSING_PARAM):
lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_01.py:26:	if (rc == lnetconfig.LUSTRE_CFG_RC_MISSING_PARAM):
lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_01.py:36:	if (rc == lnetconfig.LUSTRE_CFG_RC_MISSING_PARAM):
lustre/tests/lutf/python/tests/suite_dlc/test_dlc_libconfig_01.py:46:	if (rc == lnetconfig.LUSTRE_CFG_RC_MISSING_PARAM):
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Of the external usage:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the first one is cosmetic (it sets the error, then it is only checked if not &lt;tt&gt;LUSTRE_CFG_RC_BAD_PARAM&lt;/tt&gt;).&lt;/li&gt;
	&lt;li&gt;the second one is printed in an error message&lt;/li&gt;
	&lt;li&gt;the last two in &lt;tt&gt;lnetctl&lt;/tt&gt; are actually clobbered after being set (&lt;tt&gt;rc = yaml_lnet_peer()&lt;/tt&gt; is called immediately afterward)&lt;/li&gt;
	&lt;li&gt;I can&apos;t really comment about the Python usage, but think &lt;tt&gt;lutf&lt;/tt&gt; is both currently not even tested, and also just a test case, so compatibility is mostly irrelevant&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="399436" author="gerrit" created="Fri, 12 Jan 2024 09:18:06 +0000"  >&lt;p&gt;&quot;Arshad Hussain &amp;lt;arshad.hussain@aeoncomputing.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/53657&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/53657&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-17414&quot; title=&quot;liblnetconfig printing bogus error numbers for users&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-17414&quot;&gt;&lt;del&gt;LU-17414&lt;/del&gt;&lt;/a&gt; lnet: Use POSIX error for libnetconfig&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 2ddbfd4e4d7cc9ea210a3491038c8264a6614c51&lt;/p&gt;</comment>
                            <comment id="402559" author="gerrit" created="Sun, 4 Feb 2024 08:31:46 +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/+/53657/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/53657/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-17414&quot; title=&quot;liblnetconfig printing bogus error numbers for users&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-17414&quot;&gt;&lt;del&gt;LU-17414&lt;/del&gt;&lt;/a&gt; lnet: Use POSIX error number for libnetconfig&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 6c3a2841a77c2f11fd424b0b949d0c77a1ee4026&lt;/p&gt;</comment>
                            <comment id="402585" author="pjones" created="Sun, 4 Feb 2024 14:47:43 +0000"  >&lt;p&gt;Merged for 2.16&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|i04747:</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>