From: Andrew Morton <akpm@linux-foundation.org>
To: xemul@openvz.org
Cc: devel@openvz.org, linux-kernel@vger.kernel.org,
containers@lists.osdl.org, oleg@tv-sign.ru, sukadev@us.ibm.com
Subject: Re: [PATCH 19/20] Changes to show virtual ids to user
Date: Tue, 14 Aug 2007 13:12:02 -0700 [thread overview]
Message-ID: <20070814131202.73b7d559.akpm@linux-foundation.org> (raw)
In-Reply-To: <46BC508C.mailGLJ118R5H@openvz.org>
On Fri, 10 Aug 2007 15:48:28 +0400
xemul@openvz.org wrote:
> This is the largest patch in the set. Make all (I hope) the places where
> the pid is shown to or get from user operate on the virtual pids.
>
> The idea is:
> - all in-kernel data structures must store either struct pid itself
> or the pid's global nr, obtained with pid_nr() call;
> - when seeking the task from kernel code with the stored id one
> should use find_task_by_pid() call that works with global pids;
> - when showing pid's numerical value to the user the virtual one
> should be used, but however when one shows task's pid outside this
> task's namespace the global one is to be used;
> - when getting the pid from userspace one need to consider this as
> the virtual one and use appropriate task/pid-searching functions.
>
> ...
>
> - si.si_pid = current->pid;
> + si.si_pid = task_pid_vnr(current);
This is going to be an ongoing maintenance problem: people will sneak
new references to current->pid into the tree and nobody will notice.
It'd be best to rename task_struct.pid to something else to catch such
problems and to force people to use the right accessors. Is that feasible?
Generally this is a tactic which should be used whenever things like this
are virtualised.
next prev parent reply other threads:[~2007-08-14 20:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-10 11:48 [PATCH 19/20] Changes to show virtual ids to user xemul
2007-08-14 20:12 ` Andrew Morton [this message]
2007-08-16 12:13 ` Serge E. Hallyn
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=20070814131202.73b7d559.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=containers@lists.osdl.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@tv-sign.ru \
--cc=sukadev@us.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