<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:55:52 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-12814] lov: stripe_count variable set but unused</title>
                <link>https://jira.whamcloud.com/browse/LU-12814</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Compiling with a recent version of gcc and with &lt;tt&gt;-Wall -Werrno&lt;/tt&gt; yields the following error message:&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;/home/user/lustre-release/lustre/lov/lov_internal.h:130:7: error: variable &#8216;stripe_count&#8217; set but not used [-Werror=unused-but-set-variable]
   u16 stripe_count;
       ^~~~~~~~~~~~
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The code looks like this:&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-keyword&quot;&gt;static&lt;/span&gt; inline size_t lov_comp_md_size(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lov_stripe_md *lsm)
{
        struct lov_stripe_md_entry *lsme;
        size_t size;
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; entry;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lsm-&amp;gt;lsm_magic == LOV_MAGIC_V1 || lsm-&amp;gt;lsm_magic == LOV_MAGIC_V3)
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; lov_mds_md_size(lsm-&amp;gt;lsm_entries[0]-&amp;gt;lsme_stripe_count,
                                       lsm-&amp;gt;lsm_entries[0]-&amp;gt;lsme_magic);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lsm-&amp;gt;lsm_magic == LOV_MAGIC_FOREIGN)
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; lsm-&amp;gt;lsm_foreign_size;

        LASSERT(lsm-&amp;gt;lsm_magic == LOV_MAGIC_COMP_V1);

        size = sizeof(struct lov_comp_md_v1);
        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (entry = 0; entry &amp;lt; lsm-&amp;gt;lsm_entry_count; entry++) {
                u16 stripe_count;

                lsme = lsm-&amp;gt;lsm_entries[entry];

                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lsme_inited(lsme))
                        stripe_count = lsme-&amp;gt;lsme_stripe_count;
                &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
                        stripe_count = 0;

                size += sizeof(*lsme);
                size += lov_mds_md_size(lsme-&amp;gt;lsme_stripe_count,
                                        lsme-&amp;gt;lsme_magic);
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; size;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I am not familiar with the function, but just by considering how it is implemented, I think the lines:&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;
                size += lov_mds_md_size(lsme-&amp;gt;lsme_stripe_count,
                                        lsme-&amp;gt;lsme_magic);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;shoud rather be:&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;
                size += lov_mds_md_size(stripe_count, lsme-&amp;gt;lsme_magic);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Can anyone confirm this?&lt;/p&gt;</description>
                <environment></environment>
        <key id="57019">LU-12814</key>
            <summary>lov: stripe_count variable set but unused</summary>
                <type id="9" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/undefined.png">Question/Request</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="bobijam">Zhenyu Xu</assignee>
                                    <reporter username="cealustre">CEA</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Sep 2019 13:44:58 +0000</created>
                <updated>Thu, 28 Jul 2022 08:00:43 +0000</updated>
                            <resolved>Thu, 28 Jul 2022 08:00:43 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="255620" author="pjones" created="Mon, 30 Sep 2019 17:24:21 +0000"  >&lt;p&gt;Bobijam&lt;/p&gt;

&lt;p&gt;Could you please advise?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="341835" author="bobijam" created="Thu, 28 Jul 2022 08:00:43 +0000"  >&lt;p&gt;with patch &lt;a href=&quot;https://review.whamcloud.com/#/c/37493/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/#/c/37493/&lt;/a&gt;&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|i00nfj:</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>