All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: ebiederm@xmission.com (Eric W. Biederman)
Cc: "Vegard Nossum" <vegard.nossum@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Pavel Emelyanov" <xemul@openvz.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: find: WARNING: Hard link count is wrong for /proc/1
Date: Mon, 2 Jun 2008 19:10:16 -0700	[thread overview]
Message-ID: <20080602191016.85ce404b.akpm@linux-foundation.org> (raw)
In-Reply-To: <m163srxoq5.fsf@frodo.ebiederm.org>

On Mon, 02 Jun 2008 18:59:46 -0700 ebiederm@xmission.com (Eric W. Biederman) wrote:

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

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?



  reply	other threads:[~2008-06-03  2:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02  6:31 find: WARNING: Hard link count is wrong for /proc/1 Vegard Nossum
2008-06-02  7:00 ` Vegard Nossum
2008-06-02  7:03   ` Vegard Nossum
2008-06-02 15:53   ` Jan Kara
2008-06-02 16:11   ` Pekka Enberg
2008-06-02 16:14     ` Pekka Enberg
2008-06-03  1:59   ` Eric W. Biederman
2008-06-03  2:10     ` Andrew Morton [this message]
     [not found]       ` <m1fxrv18q2.fsf@x61.ebiederm.org>
2008-06-03  4:06         ` Vegard Nossum
2008-06-02 22:29 ` Rafael C. de Almeida

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=20080602191016.85ce404b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vegard.nossum@gmail.com \
    --cc=xemul@openvz.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.