<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:22:08 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-2073] procfs symlinks are apparently never freed</title>
                <link>https://jira.whamcloud.com/browse/LU-2073</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;It looks like we need to somehow free lustre subdevice symlinks. After running with memleak detector I see a bunch of entries 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;unreferenced object 0xffff880131381458 (size 64):
  comm &lt;span class=&quot;code-quote&quot;&gt;&quot;llog_process_th&quot;&lt;/span&gt;, pid 12528, jiffies 4296618724
  hex dump (first 32 bytes):
    2e 2e 2f 6f 73 70 2f 6c 75 73 74 72 65 2d 4f 53  ../osp/lustre-OS
    54 30 30 30 31 2d 6f 73 63 2d 4d 44 54 30 30 30  T0001-osc-MDT000
  backtrace:
    [&amp;lt;ffffffff814e4aee&amp;gt;] kmemleak_alloc+0x5e/0xd0
    [&amp;lt;ffffffff81164533&amp;gt;] __kmalloc+0x1c3/0x2f0
    [&amp;lt;ffffffff811eb433&amp;gt;] proc_symlink+0x53/0xb0
    [&amp;lt;ffffffffa0370c5a&amp;gt;] 0xffffffffa0370c5a
...

unreferenced object 0xffff8800dc8cc2a0 (size 64):
  comm &lt;span class=&quot;code-quote&quot;&gt;&quot;llog_process_th&quot;&lt;/span&gt;, pid 12528, jiffies 4296618722
  hex dump (first 32 bytes):
    2e 2e 2f 6f 73 70 2f 6c 75 73 74 72 65 2d 4f 53  ../osp/lustre-OS
    54 30 30 30 30 2d 6f 73 63 2d 4d 44 54 30 30 30  T0000-osc-MDT000
  backtrace:
    [&amp;lt;ffffffff814e4aee&amp;gt;] kmemleak_alloc+0x5e/0xd0
    [&amp;lt;ffffffff81164533&amp;gt;] __kmalloc+0x1c3/0x2f0
    [&amp;lt;ffffffff811eb433&amp;gt;] proc_symlink+0x53/0xb0
    [&amp;lt;ffffffffa0370c5a&amp;gt;] 0xffffffffa0370c5a
...
unreferenced object 0xffff880250630400 (size 64):
  comm &lt;span class=&quot;code-quote&quot;&gt;&quot;mount.lustre&quot;&lt;/span&gt;, pid 12525, jiffies 4296617672
  hex dump (first 32 bytes):
    2e 2e 2f 2e 2e 2f 2e 2e 2f 6d 64 63 2f 6c 75 73  ../../../mdc/lus
    74 72 65 2d 4d 44 54 30 30 30 30 2d 6d 64 63 2d  tre-MDT0000-mdc-
  backtrace:
    [&amp;lt;ffffffff814e4aee&amp;gt;] kmemleak_alloc+0x5e/0xd0
    [&amp;lt;ffffffff81164533&amp;gt;] __kmalloc+0x1c3/0x2f0
    [&amp;lt;ffffffff811eb433&amp;gt;] proc_symlink+0x53/0xb0
    [&amp;lt;ffffffffa0370c5a&amp;gt;] 0xffffffffa0370c5a
...
unreferenced object 0xffff88014c3e7ea0 (size 32):
  comm &lt;span class=&quot;code-quote&quot;&gt;&quot;llog_process_th&quot;&lt;/span&gt;, pid 12225, jiffies 4296616700
  hex dump (first 32 bytes):
    2e 2e 2f 6c 6f 64 2f 6c 75 73 74 72 65 2d 4d 44  ../lod/lustre-MD
    54 30 30 30 30 2d 6d 64 74 6c 6f 76 00 5a 5a a5  T0000-mdtlov.ZZ.
  backtrace:
    [&amp;lt;ffffffff814e4aee&amp;gt;] kmemleak_alloc+0x5e/0xd0
    [&amp;lt;ffffffff81164533&amp;gt;] __kmalloc+0x1c3/0x2f0
    [&amp;lt;ffffffff811eb433&amp;gt;] proc_symlink+0x53/0xb0
    [&amp;lt;ffffffffa0370c5a&amp;gt;] 0xffffffffa0370c5a
...
unreferenced object 0xffff8800d85ab820 (size 64):
  comm &lt;span class=&quot;code-quote&quot;&gt;&quot;mount.lustre&quot;&lt;/span&gt;, pid 12178, jiffies 4296616645
  hex dump (first 32 bytes):
    2e 2e 2f 2e 2e 2f 6f 73 64 2d 6c 64 69 73 6b 66  ../../osd-ldiskf
    73 2f 6c 75 73 74 72 65 2d 4d 44 54 30 30 30 30  s/lustre-MDT0000
  backtrace:
    [&amp;lt;ffffffff814e4aee&amp;gt;] kmemleak_alloc+0x5e/0xd0
    [&amp;lt;ffffffff81164533&amp;gt;] __kmalloc+0x1c3/0x2f0
    [&amp;lt;ffffffff811eb433&amp;gt;] proc_symlink+0x53/0xb0
    [&amp;lt;ffffffffa0370c5a&amp;gt;] 0xffffffffa0370c5a
...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and so on.&lt;/p&gt;</description>
                <environment></environment>
        <key id="16213">LU-2073</key>
            <summary>procfs symlinks are apparently never freed</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="ys">Yang Sheng</assignee>
                                    <reporter username="green">Oleg Drokin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Oct 2012 00:43:04 +0000</created>
                <updated>Wed, 7 Nov 2012 13:45:07 +0000</updated>
                            <resolved>Wed, 7 Nov 2012 13:45:07 +0000</resolved>
                                                    <fixVersion>Lustre 2.4.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="45839" author="bzzz" created="Tue, 2 Oct 2012 05:41:45 +0000"  >&lt;p&gt;there is the following lines in osp:&lt;/p&gt;

&lt;p&gt;if (m-&amp;gt;opd_symlink)&lt;br/&gt;
	lprocfs_remove(&amp;amp;m-&amp;gt;opd_symlink);&lt;/p&gt;
</comment>
                            <comment id="45886" author="green" created="Tue, 2 Oct 2012 14:30:17 +0000"  >&lt;p&gt;Looking at lprocfs_remove_nolock we see 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;#ifdef HAVE_PROCFS_USERS
                /* &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; procfs uses user count to synchronize deletion of
                 * proc entry, there is no protection &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; rm_entry-&amp;gt;data,
                 * then lprocfs_fops_read and lprocfs_fops_write maybe
                 * call proc_dir_entry-&amp;gt;read_proc (or write_proc) with
                 * proc_dir_entry-&amp;gt;data == NULL, then cause kernel Oops.
                 * see bug19706 &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; detailed information */

                /* procfs won&lt;span class=&quot;code-quote&quot;&gt;&apos;t free rm_entry-&amp;gt;data &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it isn&apos;&lt;/span&gt;t a LINK,
                 * and Lustre won&apos;t use rm_entry-&amp;gt;data &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; it is a LINK */
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISLNK(rm_entry-&amp;gt;mode))
                        rm_entry-&amp;gt;data = NULL;
#&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, if we look into proc_symlink, we see that entry-&amp;gt;data is kmalloced so that&apos;s how the leak appears.&lt;/p&gt;

&lt;p&gt;In free_proc_entry we can see:&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;if&lt;/span&gt; (S_ISLNK(de-&amp;gt;mode))
                kfree(de-&amp;gt;data);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As such I think the assignment of NULL is in error.&lt;/p&gt;

&lt;p&gt;Last person touching this code (and probably even adding the NULL assignment) was YangSheng, so perhaps he can chime in here?&lt;/p&gt;</comment>
                            <comment id="46015" author="pjones" created="Thu, 4 Oct 2012 15:05:54 +0000"  >&lt;p&gt;Yangsheng&lt;/p&gt;

&lt;p&gt;Could you please look into this one?&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="47279" author="ys" created="Fri, 2 Nov 2012 01:24:24 +0000"  >&lt;p&gt;Patch commit to :&lt;a href=&quot;http://review.whamcloud.com/4434&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/4434&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="47535" author="pjones" created="Wed, 7 Nov 2012 13:45:07 +0000"  >&lt;p&gt;Landed for 2.4&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|hzv4wf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4327</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>