From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Yan, Zheng" <zyan@redhat.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] vfs: fix reference leak in d_prune_aliases()
Date: Wed, 19 Nov 2014 08:24:18 +0000 [thread overview]
Message-ID: <20141119082418.GW7996@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1416383434-1908-1-git-send-email-zyan@redhat.com>
On Wed, Nov 19, 2014 at 03:50:34PM +0800, Yan, Zheng wrote:
> Signed-off-by: Yan, Zheng <zyan@redhat.com>
> ---
> fs/dcache.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/dcache.c b/fs/dcache.c
> index 3ffef7f..5bc72b0 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -778,6 +778,7 @@ restart:
> struct dentry *parent = lock_parent(dentry);
> if (likely(!dentry->d_lockref.count)) {
> __dentry_kill(dentry);
> + dput(parent);
> goto restart;
> }
> if (parent)
Good catch... Applied, will push to Linus. I'm putting the following as
commit message:
In "d_prune_alias(): just lock the parent and call __dentry_kill()" the old
dget + d_drop + dput has been replaced with lock_parent + __dentry_kill;
unfortunately, dput() does more than just killing dentry - it also drops the
reference to parent. New variant leaks that reference and needs dput(parent)
after killing the child off.
Is the above OK with you?
prev parent reply other threads:[~2014-11-19 8:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 7:50 [PATCH] vfs: fix reference leak in d_prune_aliases() Yan, Zheng
2014-11-19 8:24 ` Al Viro [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141119082418.GW7996@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=zyan@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).