From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756773AbYFCCK3 (ORCPT ); Mon, 2 Jun 2008 22:10:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753465AbYFCCKV (ORCPT ); Mon, 2 Jun 2008 22:10:21 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:41814 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbYFCCKU (ORCPT ); Mon, 2 Jun 2008 22:10:20 -0400 Date: Mon, 2 Jun 2008 19:10:16 -0700 From: Andrew Morton To: ebiederm@xmission.com (Eric W. Biederman) Cc: "Vegard Nossum" , linux-kernel@vger.kernel.org, "Pavel Emelyanov" , "David S. Miller" Subject: Re: find: WARNING: Hard link count is wrong for /proc/1 Message-Id: <20080602191016.85ce404b.akpm@linux-foundation.org> In-Reply-To: References: <19f34abd0806012331m7c57468bu820e9b6b0184836d@mail.gmail.com> <19f34abd0806020000h407e3fb1kadff228a3cf4c6f@mail.gmail.com> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 02 Jun 2008 18:59:46 -0700 ebiederm@xmission.com (Eric W. Biederman) wrote: > > From: Vegard Nossum > Date: Mon, 2 Jun 2008 08:57:45 +0200 > Subject: [PATCH] proc: fix /proc/ link count > > commit e9720acd728a46cb40daa52c99a979f7c4ff195c > Author: Pavel Emelyanov > Date: Fri Mar 7 11:08:40 2008 -0800 > > [NET]: Make /proc/net a symlink on /proc/self/net (v3) > > introduced /proc/net without bumping the link count on /proc/self. > > Signed-off-by: Vegard Nossum > Acked-by: "Eric W. Biederman" > > --- > fs/proc/base.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/fs/proc/base.c b/fs/proc/base.c > index c447e07..10ee4a2 100644 > --- a/fs/proc/base.c > +++ b/fs/proc/base.c > @@ -2589,6 +2589,9 @@ static struct dentry > *proc_pid_instantiate(struct inode *dir, > #ifdef CONFIG_SECURITY > inode->i_nlink += 1; > #endif > +#ifdef CONFIG_NET > + inode->i_nlink += 1; > +#endif > > dentry->d_op = &pid_dentry_operations; A bit more explanation would be nice. I assume that here we're accounting for a reference which net applies to this dentry. But it would be clearer and more robust to do that at the site where that reference is really taken, not over in proc_pid_instantiate(). Possible?