public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: Ian Kent <raven@themaw.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	hpa@zytor.com, Pavel Emelyanov <xemul@openvz.org>,
	Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] autofs: fix the wrong usage of the deprecated task_pgrp_nr()
Date: Mon, 19 Jan 2009 22:31:46 +0100	[thread overview]
Message-ID: <20090119213146.GA31593@redhat.com> (raw)
In-Reply-To: <20090119204839.GA21009@us.ibm.com>

On 01/19, Serge E. Hallyn wrote:
>
> Quoting Oleg Nesterov (oleg@redhat.com):
> > 
> > This is the next patch. This one does
> > 
> > 	--- CUR/fs/autofs/inode.c~1_AUTOFS	2009-01-12 23:07:46.000000000 +0100
> > 	+++ CUR/fs/autofs/inode.c	2009-01-18 06:18:49.000000000 +0100
> > 	@@ -78,7 +78,7 @@ static int parse_options(char *options, 
> > 	 
> > 		*uid = current_uid();
> > 		*gid = current_gid();
> > 	-	*pgrp = task_pgrp_nr(current);
> > 	+	*pgrp = task_pgrp_vnr(current);
> 
> Ok, that was the one I had looked at earlier (though now I can't find
> it).  But that just seems wrong to me.  We should certainly not be
> caching a pid_vnr in the kernel.  That is imo incomparably worse than
> storing a pid_nr.

We do not cache it. We use this pgrp as an argument for find_pid()
right after return from parse_options(). And find_pid() uses
current->nsproxy->pid_ns. That is why this is bugfix.

> Can we just jump straight to caching the struct pid?

Of course it is ugly to store pid_t and then call find_pid(),
I don't understand why the code was written this way. But I
am not going to cleanup this code ;)

(note also that the 2nd patch I sent for autofs4 does not use
 pid_t at all).

> > passing pid_t's in from userspace uses current namespace, with
> > or without the patch.
>
> Which makes sense on the one hand, but OTOH could be confusing
> if as I requested we print out init_pid_ns values.  (sigh)

But it is not possible to pass the global pid_t from within
the subnamespace via "pgrp=" option, automount (or whatever)
just can't know it when it runs in the subnamespace.

> Yes... would it be overkill to just print both?

perharps, I don't know...

But this is imho a bit off-topic, we can change the debugging
output later any way we like.

Oleg.


  reply	other threads:[~2009-01-19 21:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-18  7:34 [PATCH] autofs: fix the wrong usage of the deprecated task_pgrp_nr() Oleg Nesterov
2009-01-19  2:20 ` Ian Kent
2009-01-19  6:35   ` H. Peter Anvin
2009-01-19  7:45     ` Ian Kent
2009-01-19 17:09       ` H. Peter Anvin
2009-01-20  1:18         ` Ian Kent
2009-01-19  7:08   ` Oleg Nesterov
2009-01-19  8:11     ` Ian Kent
2009-01-19  8:32       ` Oleg Nesterov
2009-01-19 11:15         ` Ian Kent
2009-01-19 12:42           ` Oleg Nesterov
2009-01-19 13:33             ` Ian Kent
2009-01-19 14:30               ` Oleg Nesterov
2009-01-19 17:48                 ` Serge E. Hallyn
2009-01-19 18:05                   ` Oleg Nesterov
2009-01-19 18:24                     ` Serge E. Hallyn
2009-01-19 19:17                       ` Oleg Nesterov
2009-01-19 19:20                         ` H. Peter Anvin
2009-01-19 19:32                           ` Oleg Nesterov
2009-01-19 19:35                         ` Serge E. Hallyn
2009-01-19 20:04                           ` Oleg Nesterov
2009-01-19 20:48                             ` Serge E. Hallyn
2009-01-19 21:31                               ` Oleg Nesterov [this message]
2009-01-19 22:11                                 ` Serge E. Hallyn
2009-01-20  2:07                                 ` Ian Kent
2009-01-20  1:35                         ` Ian Kent
2009-01-20  1:38                           ` H. Peter Anvin
2009-01-20  7:08                           ` Oleg Nesterov
2009-01-23  4:48 ` Ian Kent
2009-01-23  8:13   ` Oleg Nesterov
2009-01-23  9:09     ` Ian Kent

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=20090119213146.GA31593@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    --cc=serue@us.ibm.com \
    --cc=sukadev@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox