<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:07:24 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-14164] libcfs_str2nid() gives undesirable output</title>
                <link>https://jira.whamcloud.com/browse/LU-14164</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;On my system (for some reason) resolving an unknown hostname returns the loopback IP (127.0.0.1).&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;
&amp;gt;# getent hosts mgs.exports.192.168.122.100
::1 mgs.exports.192.168.122.100.localhost &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;this ends up breaking specific commands, like&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;
 lctl get_param -n *.MGS*.exports.192.168.122.100@tcp.uuid&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;this ends up trying to look at:&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;
 mgs/mgs/exports/192/168/122/100@tcp999/uuid&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The reason is that get&#160;&lt;tt&gt;hostbyname()&lt;/tt&gt; called from&#160;&lt;tt&gt;clean_path()-&amp;gt;libcfs_str2nid()&lt;/tt&gt; returns&#160;&lt;tt&gt;127.0.0.1&lt;/tt&gt; for &quot;&lt;tt&gt;exports.192.168.122.100&quot;&lt;/tt&gt;. This leads the to the NID not found in the string which leads to the IP address being included in the path.&lt;/p&gt;

&lt;p&gt;To be clear this seems to be an issue on my setup. Filing this ticket to raise awareness that this could happen.&lt;/p&gt;

&lt;p&gt;I ran into it while trying to run sanity-sec:test_31&lt;/p&gt;</description>
                <environment></environment>
        <key id="61810">LU-14164</key>
            <summary>libcfs_str2nid() gives undesirable output</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="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="ashehata">Amir Shehata</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Dec 2020 02:15:18 +0000</created>
                <updated>Tue, 1 Dec 2020 18:43:35 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="286349" author="adilger" created="Tue, 1 Dec 2020 10:52:15 +0000"  >&lt;p&gt;I think it would be ok to return &lt;tt&gt;LNET_NID_ANY&lt;/tt&gt; in case of 127.0.0.1, since we already do not allow the TCP loop back interface to be configured for LNet. That is typically an error due to &quot;$hostname&quot; being aliased to &lt;tt&gt;localhost&lt;/tt&gt;, and using the LNet &lt;tt&gt;0@lo&lt;/tt&gt; interface is more efficient. &lt;/p&gt;</comment>
                            <comment id="286398" author="adilger" created="Tue, 1 Dec 2020 18:43:35 +0000"  >&lt;p&gt;See, for example, the code in &lt;tt&gt;lustre/utils/mkfs_lustre.c&lt;/tt&gt; that verifies the server NID:&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;
                nid = libcfs_str2nid(s1);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (nid == LNET_NID_ANY) {
                        fprintf(stderr, &lt;span class=&quot;code-quote&quot;&gt;&quot;%s: Cannot resolve hostname &lt;span class=&quot;code-quote&quot;&gt;&apos;%s&apos;&lt;/span&gt;.\n&quot;&lt;/span&gt;,
                                progname, s1);
                        free(converted);
                        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; NULL;
                }
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strncmp(libcfs_nid2str(nid), &lt;span class=&quot;code-quote&quot;&gt;&quot;127.0.0.1&quot;&lt;/span&gt;,
                            strlen(&lt;span class=&quot;code-quote&quot;&gt;&quot;127.0.0.1&quot;&lt;/span&gt;)) == 0) {
                        fprintf(stderr,
                                &lt;span class=&quot;code-quote&quot;&gt;&quot;%s: The NID &lt;span class=&quot;code-quote&quot;&gt;&apos;%s&apos;&lt;/span&gt; resolves to the loopback address &lt;span class=&quot;code-quote&quot;&gt;&apos;%s&apos;&lt;/span&gt;.  Lustre requires a non-loopback address.\n&quot;&lt;/span&gt;,
                                progname, s1, libcfs_nid2str(nid));
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It may be that returning &lt;tt&gt;LNET_NID_ANY&lt;/tt&gt; for 127.0.0.1 would prevent this message from being printed properly, which I think would be confusing to users, so it may be that &lt;tt&gt;clean_path()&lt;/tt&gt; needs a similar check:&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;
                        nid = libcfs_str2nid(tmp);
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (nid != LNET_NID_ANY) {
                                nidstr = libcfs_nid2str(nid);
                                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!nidstr)
                                       &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; -EINVAL;
+                               /* some DNS resolvers &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; localhost &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; unknown hosts,
+                                * but &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; can never be valid NID &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; any mounted client.
+                                */
+                               &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (strncmp(nidstr, &lt;span class=&quot;code-quote&quot;&gt;&quot;127.0.0.1&quot;&lt;/span&gt;, strlen(&lt;span class=&quot;code-quote&quot;&gt;&quot;127.0.0.1&quot;&lt;/span&gt;)) == 0) {
+                                      nidstr = NULL;
+                                      &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
+                               }
                                &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
                        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Amir, can you see if this solves your problem?&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|i01g1j:</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>