<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:11:13 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-14609] potential memory leak in osp_it_fetch()</title>
                <link>https://jira.whamcloud.com/browse/LU-14609</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;It appears there may be a memory leak in the error handling in &lt;tt&gt;osp_it_fetch()&lt;/tt&gt;:&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;
        OBD_ALLOC(pages, npages * sizeof(*pages));
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (pages == NULL)
                RETURN(-ENOMEM);

        it-&amp;gt;ooi_pages = pages;
        it-&amp;gt;ooi_total_npages = npages;
        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (i = 0; i &amp;lt; npages; i++) {
                pages[i] = alloc_page(GFP_NOFS);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (pages[i] == NULL)
                        RETURN(-ENOMEM);
        }
        req = ptlrpc_request_alloc(osp-&amp;gt;opd_obd-&amp;gt;u.cli.cl_import,
                                   &amp;amp;RQF_OBD_IDX_READ);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (req == NULL)
                RETURN(-ENOMEM);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This looks like it will leak the &lt;tt&gt;pages&lt;/tt&gt; array in the first case (up to 2KB), and the allocated pages themselves (up to 1MB) if the &lt;tt&gt;req&lt;/tt&gt; allocation fails.  I&apos;m not 100% sure in this is an actual leak, because the &lt;tt&gt;pages&lt;/tt&gt; array is saved to &lt;tt&gt;ooi_pages&lt;/tt&gt;, and that is freed in &lt;tt&gt;osp_it_fini()&lt;/tt&gt;, but I&apos;m not yet convinced that is always called in the error case. &lt;/p&gt;

&lt;p&gt;This was found by code inspection while looking for large page array allocations (of which this is not currently a case).&lt;/p&gt;

&lt;p&gt;Code was added in commit v2_5_56_0-4-g77eea1985b patch &lt;a href=&quot;http://review.whamcloud.com/8303&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/8303&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-3336&quot; title=&quot;LFSCK II: MDT-OST OST orphan handling&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-3336&quot;&gt;&lt;del&gt;LU-3336&lt;/del&gt;&lt;/a&gt; lfsck: orphan OST-objects iteration&lt;/tt&gt;&quot;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="63754">LU-14609</key>
            <summary>potential memory leak in osp_it_fetch()</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="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Apr 2021 21:52:08 +0000</created>
                <updated>Mon, 12 Apr 2021 22:10:19 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="298592" author="gerrit" created="Mon, 12 Apr 2021 22:10:19 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/43283&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/43283&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-14609&quot; title=&quot;potential memory leak in osp_it_fetch()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-14609&quot;&gt;LU-14609&lt;/a&gt; osp: fix memory leak in osp_it_fetch()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 59ea2a9d094bc900af84a7fdbdb7966e0f940c46&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|i01ryv:</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>