From: Oleg Nesterov <oleg@redhat.com>
To: Ian Kent <raven@themaw.net>
Cc: 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, "SergeE.Hallyn" <serue@us.ibm.com>
Subject: Re: [PATCH] autofs: fix the wrong usage of the deprecated task_pgrp_nr()
Date: Mon, 19 Jan 2009 15:30:46 +0100 [thread overview]
Message-ID: <20090119143046.GA8284@redhat.com> (raw)
In-Reply-To: <1232372016.3136.155.camel@zeus.themaw.net>
On 01/19, Ian Kent wrote:
>
> On Mon, 2009-01-19 at 13:42 +0100, Oleg Nesterov wrote:
> >
> > Before the patch
> >
> > sbi->oz_pgrp != task_pgrp(automount)
> >
> > After the patch
> >
> > sbi->oz_pgrp == task_pgrp(automount)
> >
> > And please note that these "!="/"==" apply to any namespace. I mean,
> > when we call autofs_oz_mode() it does not matter in which namespace
> > autofs_oz_mode() is executed, we compare "struct pid*", not pid_t.
>
> I think your saying that the option pgrp= is broken and should be
> deprecated
No, no, sorry if I confused you.
If the "pgrp=" option was specified, the patch has no effect, and the
code is correct with or without the patch.
> It's interesting that your description appears to assume the the same
> process may appear in different pid namespaces (am I right?)
Yes. It is visible in its own namespace, in the ->parent namespace,
->parent->parent, and so on until the global init_pid_ns.
> whereas in
> the descriptions I have been writing I'm thinking of pid namspeces as
> having there own set of proceses and not being able to see processes
> outside the space.
Yes, we can not see the tasks outside the space (but of course we can
see the tasks from the child namespaces).
IOW. Let's suppose we are in the global namespace, and some task
forks the child C via clone(CLONE_NEWPID).
Now, in the global namespace it has, say, pid == 100. But when
C does sys_getpid() it gets 1.
C can not see the tasks from the global namespace, but any task
from the global ns can see C with pid == 100.
And please note that C has the single "struct pid" wchich represents
all pid_t's. The same for pgrp/session. task_pgrp() returns the same
pid (pointer to the struct, not pid_t), no matter in which namespace
the code runs. But the result of pid_vnr(pid) or find_pid(pid_nr) do
differ depending on current->nsproxy->pid_ns.
Oleg.
next prev parent reply other threads:[~2009-01-19 14:33 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 [this message]
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
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=20090119143046.GA8284@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