<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:20: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-15689] libcfs_debug_mb is not set correctly if module has not been initialized</title>
                <link>https://jira.whamcloud.com/browse/LU-15689</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;If libcfs_debug_mb parameter is specified to insmod (i.e. set before module is initialized) then it does not get initialized correctly. This appears to be a regression from:&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;commit 8b78a3ffb5220330f41b4fa8576a05c4e017cfb1
Author: Mr NeilBrown &amp;lt;neilb@suse.de&amp;gt;
Date:   Sun Mar 8 21:35:57 2020 -0400

   LU-9859 libcfs: always range-check libcfs_debug_mb setting.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;diff --git a/libcfs/libcfs/debug.c b/libcfs/libcfs/debug.c
index 99518ab116..e5bff2e18a 100644
--- a/libcfs/libcfs/debug.c
+++ b/libcfs/libcfs/debug.c
@@ -65,21 +65,15 @@ static int libcfs_param_debug_mb_set(const char *val,
        if (rc &amp;lt; 0)
                return rc;

-/*
- * RHEL6 does not support any kind of locking so we have to provide
- * our own
- */
-       if (!*((unsigned int *)kp-&amp;gt;arg)) {
-               *((unsigned int *)kp-&amp;gt;arg) = num;
-               return 0;
-       }
+       num = cfs_trace_set_debug_mb(num);

-       rc = cfs_trace_set_debug_mb(num);
-
-       if (!rc)
-               *((unsigned int *)kp-&amp;gt;arg) = cfs_trace_get_debug_mb();
+       *((unsigned int *)kp-&amp;gt;arg) = num;
+       num = cfs_trace_get_debug_mb();
+       if (num)
+               /* This value is more precise */
+               *((unsigned int *)kp-&amp;gt;arg) = num;

-       return rc;
+       return 0;
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think the idea is that cfs_trace_get_debug_mb() would only return non-zero if the module had been initialized, so it&apos;s return value should be used instead of the return val from cfs_trace_set_debug_mb(). However, cfs_trace_get_debug_mb() never returns 0:&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;int cfs_trace_get_debug_mb(void)
{
...
        return (total_pages &amp;gt;&amp;gt; (20 - PAGE_SHIFT)) + 1;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We can see it will always return at least 1.&lt;/p&gt;</description>
                <environment></environment>
        <key id="69252">LU-15689</key>
            <summary>libcfs_debug_mb is not set correctly if module has not been initialized</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="hornc">Chris Horn</assignee>
                                    <reporter username="hornc">Chris Horn</reporter>
                        <labels>
                    </labels>
                <created>Thu, 24 Mar 2022 18:14:13 +0000</created>
                <updated>Sat, 11 Jun 2022 15:52:22 +0000</updated>
                            <resolved>Sat, 11 Jun 2022 15:52:22 +0000</resolved>
                                                    <fixVersion>Lustre 2.16.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="330148" author="gerrit" created="Thu, 24 Mar 2022 18:15:33 +0000"  >&lt;p&gt;&quot;Chris Horn &amp;lt;chris.horn@hpe.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/46925&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/46925&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15689&quot; title=&quot;libcfs_debug_mb is not set correctly if module has not been initialized&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15689&quot;&gt;&lt;del&gt;LU-15689&lt;/del&gt;&lt;/a&gt; libcfs: libcfs_debug_mb set incorrectly on init&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 1502cc4440ef5b138db0ba16ab6368b963272357&lt;/p&gt;</comment>
                            <comment id="337437" author="gerrit" created="Sat, 11 Jun 2022 05:53:35 +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/46925/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/46925/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15689&quot; title=&quot;libcfs_debug_mb is not set correctly if module has not been initialized&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15689&quot;&gt;&lt;del&gt;LU-15689&lt;/del&gt;&lt;/a&gt; libcfs: libcfs_debug_mb set incorrectly on init&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: d38ef181d8250b083553ec95209c28c1dc11fa99&lt;/p&gt;</comment>
                            <comment id="337528" author="pjones" created="Sat, 11 Jun 2022 15:52:22 +0000"  >&lt;p&gt;Landed 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|i02lnj:</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>