From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] vfs: fix reference leak in d_prune_aliases() Date: Wed, 19 Nov 2014 08:24:18 +0000 Message-ID: <20141119082418.GW7996@ZenIV.linux.org.uk> References: <1416383434-1908-1-git-send-email-zyan@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: "Yan, Zheng" Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:55219 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932071AbaKSIYT (ORCPT ); Wed, 19 Nov 2014 03:24:19 -0500 Content-Disposition: inline In-Reply-To: <1416383434-1908-1-git-send-email-zyan@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Nov 19, 2014 at 03:50:34PM +0800, Yan, Zheng wrote: > Signed-off-by: Yan, Zheng > --- > 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?