Re: find: WARNING: Hard link count is wrong for /proc/1

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Vegard Nossum <vegard.nossum@...>
Cc: <linux-kernel@...>, Pavel Emelyanov <xemul@...>, David S. Miller <davem@...>, Andrew Morton <akpm@...>
Date: Monday, June 2, 2008 - 9:59 pm

From: Vegard Nossum <vegard.nossum@gmail.com>
Date: Mon, 2 Jun 2008 08:57:45 +0200
Subject: [PATCH] proc: fix /proc/<pid> link count

commit e9720acd728a46cb40daa52c99a979f7c4ff195c
Author: Pavel Emelyanov <xemul@openvz.org>
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 <vegard.nossum@gmail.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

---
 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;

-- 
1.5.4.1
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
find: WARNING: Hard link count is wrong for /proc/1, Vegard Nossum, (Mon Jun 2, 2:31 am)
Re: find: WARNING: Hard link count is wrong for /proc/1, Rafael C. de Almeida, (Mon Jun 2, 6:29 pm)
Re: find: WARNING: Hard link count is wrong for /proc/1, Vegard Nossum, (Mon Jun 2, 3:00 am)
Re: find: WARNING: Hard link count is wrong for /proc/1, Eric W. Biederman, (Mon Jun 2, 9:59 pm)
Re: find: WARNING: Hard link count is wrong for /proc/1, Andrew Morton, (Mon Jun 2, 10:10 pm)
Re: find: WARNING: Hard link count is wrong for /proc/1, Pekka Enberg, (Mon Jun 2, 12:11 pm)
Re: find: WARNING: Hard link count is wrong for /proc/1, Pekka Enberg, (Mon Jun 2, 12:14 pm)
Re: find: WARNING: Hard link count is wrong for /proc/1, Vegard Nossum, (Mon Jun 2, 3:03 am)