<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:12:43 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-14779] lctl get_param does invalid DNS lookups</title>
                <link>https://jira.whamcloud.com/browse/LU-14779</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;&lt;tt&gt;lctl get_param&lt;/tt&gt; does DNS lookups to determine if param components may be nids. But it doesn&apos;t always choose a sensible component. For example&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;lctl get_param ldlm.namespaces.MGC1.2.3.4@o2ib.lock_unused_count
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;will do &lt;tt&gt;gethostbyname(&quot;namespaces.MGC1.2.3.4&quot;)&lt;/tt&gt;. &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;# gdb lctl
...
(gdb) b gethostbyname
Breakpoint 1 at 0x402d10
(gdb) run get_param ldlm.namespaces.MGC1.2.3.4@o2ib.lock_unused_count
Starting program: /root/ex/lustre-release/lustre/utils/.libs/lctl get_param ldlm.namespaces.MGC1.2.3.4@o2ib.lock_unused_count
[Thread debugging using libthread_db enabled]
Using host libthread_db library &quot;/lib64/libthread_db.so.1&quot;.

Breakpoint 1, gethostbyname (name=0x646070 &quot;namespaces.MGC1.2.3.4&quot;) at ../nss/getXXbyYY.c:93
93	{
(gdb) bt
#0  gethostbyname (name=0x646070 &quot;namespaces.MGC1.2.3.4&quot;) at ../nss/getXXbyYY.c:93
#1  0x00007ffff7bc6334 in libcfs_ip_str2addr () from /lib64/liblustreapi.so.1
#2  0x00007ffff7bc691f in libcfs_str2nid () from /lib64/liblustreapi.so.1
#3  0x0000000000414558 in clean_path (popt=popt@entry=0x7fffffffe070, 
    path=path@entry=0x7fffffffe4eb &quot;ldlm.namespaces.MGC1.2.3.4@o2ib.lock_unused_count&quot;) at lustre_cfg.c:770
#4  0x00000000004164ae in jt_lcfg_getparam (argc=2, argv=0x7fffffffe1f0) at lustre_cfg.c:1210
#5  0x00007ffff7bc7911 in Parser_execarg () from /lib64/liblustreapi.so.1
#6  0x0000000000416f59 in lctl_main (argc=3, argv=0x7fffffffe1e8) at lctl.c:562
#7  0x00007ffff71be505 in __libc_start_main (main=0x403160 &amp;lt;main&amp;gt;, argc=3, argv=0x7fffffffe1e8, init=&amp;lt;optimized out&amp;gt;, fini=&amp;lt;optimized out&amp;gt;, 
    rtld_fini=&amp;lt;optimized out&amp;gt;, stack_end=0x7fffffffe1d8) at ../csu/libc-start.c:266
#8  0x000000000040318e in _start ()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Similarly&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;get_param obdfilter.myfs-ost001d.exports.1.2.3.4@o2ib.ldlm_stats
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;will lookup &lt;tt&gt;myfs-ost001d.exports.1.2.3.4&lt;/tt&gt; and &lt;tt&gt;exports.1.2.3.4&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;This behavior is because we are using &lt;tt&gt;libcfs_str2nid()&lt;/tt&gt; to detect NIDs. But this function is written to handle hostnames as well as NIDs.&lt;/p&gt;

&lt;p&gt;But this is not great for performance, since, in DNS as in life, looking for something that doesn&apos;t exist tends to take a lot longer than looking for something that does.&lt;/p&gt;</description>
                <environment></environment>
        <key id="64815">LU-14779</key>
            <summary>lctl get_param does invalid DNS lookups</summary>
                <type id="3" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11318&amp;avatarType=issuetype">Task</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="jhammond">John Hammond</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Jun 2021 21:41:04 +0000</created>
                <updated>Thu, 15 Jul 2021 03:14:00 +0000</updated>
                            <resolved>Thu, 8 Jul 2021 13:09:59 +0000</resolved>
                                                    <fixVersion>Lustre 2.15.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>7</watches>
                                                                            <comments>
                            <comment id="305237" author="jhammond" created="Tue, 22 Jun 2021 21:52:19 +0000"  >&lt;p&gt;Testing locally I also see &lt;tt&gt;lctl list_param -R &quot;*&quot;&lt;/tt&gt; doing &lt;tt&gt;gethostbyname(&quot;namespaces.MGC192.168.122.75&quot;)&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="305239" author="adilger" created="Tue, 22 Jun 2021 22:45:53 +0000"  >&lt;p&gt;Could we just replace this NID lookup with a simple string comparison, something like &quot;&lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;MGC&amp;#93;&lt;/span&gt;&amp;#42;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9\\.&amp;#93;&lt;/span&gt;&amp;#42;@&lt;span class=&quot;error&quot;&gt;&amp;#91;a-f0-9&amp;#93;&lt;/span&gt;&amp;#42;&lt;/tt&gt;&quot;.  I believe that would match all (currently) valid NIDs without doing any lookups or NID parsing/unparsing at all.&lt;/p&gt;

&lt;p&gt;Alternately, we could add a new libcfs_str2nid_numeric() that doesn&apos;t do any hostname lookups, since the parameter files will &lt;b&gt;always&lt;/b&gt; have the numeric NIDs in them, and not hostnames.&lt;/p&gt;</comment>
                            <comment id="305253" author="gerrit" created="Wed, 23 Jun 2021 08:33:40 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/44056&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/44056&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-14779&quot; title=&quot;lctl get_param does invalid DNS lookups&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-14779&quot;&gt;&lt;del&gt;LU-14779&lt;/del&gt;&lt;/a&gt; utils: no DNS lookups for NID in get_param&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 429170cabfc8ec4a173ca26f70a17fa4bf453804&lt;/p&gt;</comment>
                            <comment id="306556" author="gerrit" created="Thu, 8 Jul 2021 02:07:31 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/44056/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/44056/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-14779&quot; title=&quot;lctl get_param does invalid DNS lookups&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-14779&quot;&gt;&lt;del&gt;LU-14779&lt;/del&gt;&lt;/a&gt; utils: no DNS lookups for NID in get_param&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: f21c507fbca2afab5a5d97d4e816696a69d1c593&lt;/p&gt;</comment>
                            <comment id="306599" author="pjones" created="Thu, 8 Jul 2021 13:09:59 +0000"  >&lt;p&gt;Landed for 2.15&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </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|i01xhb:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>