<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:03:18 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-6794] memory leak in Lustre NFS support code, LASSERT() at unmount</title>
                <link>https://jira.whamcloud.com/browse/LU-6794</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;There is an unbalanced iput() call in Lustre NFS support code.&lt;/p&gt;

&lt;p&gt;A possible symptom is a kernel crash with&lt;br/&gt;
ASSERTION( atomic_read(&amp;amp;d-&amp;gt;ld_ref) == 0 ) failed&lt;/p&gt;

&lt;p&gt;A fix will be uploaded shortly.&lt;/p&gt;</description>
                <environment></environment>
        <key id="30909">LU-6794</key>
            <summary>memory leak in Lustre NFS support code, LASSERT() at unmount</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</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="panda">Andrew Perepechko</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Thu, 2 Jul 2015 20:22:14 +0000</created>
                <updated>Mon, 14 Sep 2015 14:37:28 +0000</updated>
                            <resolved>Thu, 16 Jul 2015 13:00:25 +0000</resolved>
                                    <version>Lustre 2.8.0</version>
                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="120211" author="gerrit" created="Thu, 2 Jul 2015 20:27:22 +0000"  >&lt;p&gt;Andrew Perepechko (andrew.perepechko@seagate.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/15480&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/15480&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6794&quot; title=&quot;memory leak in Lustre NFS support code, LASSERT() at unmount&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6794&quot;&gt;&lt;del&gt;LU-6794&lt;/del&gt;&lt;/a&gt; nfs: ASSERTION( atomic_read(&amp;amp;d-&amp;gt;ld_ref) == 0 ) failed&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 43a8fb75c98ba0d677eaa1297e21e0a4de2ec16f&lt;/p&gt;</comment>
                            <comment id="120301" author="pjones" created="Fri, 3 Jul 2015 18:24:02 +0000"  >&lt;p&gt;Bobijam&lt;/p&gt;

&lt;p&gt;Could you please take care of this patch?&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="120312" author="panda" created="Fri, 3 Jul 2015 19:40:53 +0000"  >&lt;p&gt;Based on vanilla linux.git, d_obtain_alias() has had the feature of releasing inode on error from its introduction up to now:&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;commit 4ea3ada2955e4519befa98ff55dd62d6dfbd1705
Author: Christoph Hellwig &amp;lt;hch@lst.de&amp;gt;
Date:   Mon Aug 11 15:48:57 2008 +0200

    [PATCH] &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; helper: d_obtain_alias
    
    The calling conventions of d_alloc_anon are rather unfortunate &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; all
    users, and it&apos;s name is not very descriptive either.
    
    Add d_obtain_alias as a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; exported helper that drops the inode
    reference in the failure &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt;, too and allows to pass-through NULL
    pointers and inodes to allow &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; tail-calls in the export operations.
    
    Incidentally &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; helper already existed as a &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; function in
    libfs.c as exportfs_d_alloc so kill that one and &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; the callers
    to d_obtain_alias.
    
    Signed-off-by: Christoph Hellwig &amp;lt;hch@lst.de&amp;gt;
    Signed-off-by: Al Viro &amp;lt;viro@zeniv.linux.org.uk&amp;gt;

diff --git a/fs/dcache.c b/fs/dcache.c
index e7a1a99..46fc782 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1174,6 +1174,41 @@ struct dentry * d_alloc_anon(struct inode *inode)
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; res;
 }
 
+/**
+ * d_obtain_alias - find or allocate a dentry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; a given inode
+ * @inode: inode to allocate the dentry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;
+ *
+ * Obtain a dentry &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; an inode resulting from NFS filehandle conversion or
+ * similar open by handle operations.  The returned dentry may be anonymous,
+ * or may have a full name (&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the inode was already in the cache).
+ *
+ * When called on a directory inode, we must ensure that the inode only ever
+ * has one dentry.  If a dentry is found, that is returned instead of
+ * allocating a &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; one.
+ *
+ * On successful &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;, the reference to the inode has been transferred
+ * to the dentry.  If %NULL is returned (indicating kmalloc failure),
+ * the reference on the inode has been released.  To make it easier
+ * to use in export operations a NULL or IS_ERR inode may be passed in
+ * and will be casted to the corresponding NULL or IS_ERR dentry.
+ */
+struct dentry *d_obtain_alias(struct inode *inode)
+{
+       struct dentry *dentry;
+
+       &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!inode)
+               &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; NULL;
+       &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (IS_ERR(inode))
+               &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; ERR_CAST(inode);
+
+       dentry = d_alloc_anon(inode);
+       &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!dentry) {
+               iput(inode);
+               dentry = ERR_PTR(-ENOMEM);
+       }
+       &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; dentry;
+}
+EXPORT_SYMBOL_GPL(d_obtain_alias);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;current code is:&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; struct dentry *__d_obtain_alias(struct inode *inode, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; disconnected)
{
        &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct qstr anonstring = QSTR_INIT(&lt;span class=&quot;code-quote&quot;&gt;&quot;/&quot;&lt;/span&gt;, 1);
        struct dentry *tmp;
        struct dentry *res;
        unsigned add_flags;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!inode)
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; ERR_PTR(-ESTALE);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (IS_ERR(inode))
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; ERR_CAST(inode);

        res = d_find_any_alias(inode);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (res)
                &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt; out_iput;

        tmp = __d_alloc(inode-&amp;gt;i_sb, &amp;amp;anonstring);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!tmp) {
                res = ERR_PTR(-ENOMEM);
                &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt; out_iput;
        }

        spin_lock(&amp;amp;inode-&amp;gt;i_lock);
        res = __d_find_any_alias(inode);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (res) {
                spin_unlock(&amp;amp;inode-&amp;gt;i_lock);
                dput(tmp);
                &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt; out_iput;
        }

        &lt;span class=&quot;code-comment&quot;&gt;/* attach a disconnected dentry */&lt;/span&gt;
        add_flags = d_flags_for_inode(inode);

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (disconnected)
                add_flags |= DCACHE_DISCONNECTED;

        spin_lock(&amp;amp;tmp-&amp;gt;d_lock);
        __d_set_inode_and_type(tmp, inode, add_flags);
        hlist_add_head(&amp;amp;tmp-&amp;gt;d_u.d_alias, &amp;amp;inode-&amp;gt;i_dentry);
        hlist_bl_lock(&amp;amp;tmp-&amp;gt;d_sb-&amp;gt;s_anon);
        hlist_bl_add_head(&amp;amp;tmp-&amp;gt;d_hash, &amp;amp;tmp-&amp;gt;d_sb-&amp;gt;s_anon);
        hlist_bl_unlock(&amp;amp;tmp-&amp;gt;d_sb-&amp;gt;s_anon);
        spin_unlock(&amp;amp;tmp-&amp;gt;d_lock);
        spin_unlock(&amp;amp;inode-&amp;gt;i_lock);
        security_d_instantiate(tmp, inode);

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; tmp;

 out_iput:
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (res &amp;amp;&amp;amp; !IS_ERR(res))
                security_d_instantiate(res, inode);
        iput(inode);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; res;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="121411" author="gerrit" created="Thu, 16 Jul 2015 03:26:51 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/15480/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/15480/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6794&quot; title=&quot;memory leak in Lustre NFS support code, LASSERT() at unmount&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6794&quot;&gt;&lt;del&gt;LU-6794&lt;/del&gt;&lt;/a&gt; nfs: ASSERTION( atomic_read(&amp;amp;d-&amp;gt;ld_ref) == 0 ) failed&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: a37a5a9e5e309f87db9497d187df41d0fede8d29&lt;/p&gt;</comment>
                            <comment id="121427" author="pjones" created="Thu, 16 Jul 2015 13:00:25 +0000"  >&lt;p&gt;Landed for 2.8&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="22164">LU-4272</issuekey>
        </issuelink>
                            </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|hzxh4n:</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>