From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@ftp.linux.org.uk>,
linux-kernel@vger.kernel.org, Pavel Emelyanov <xemul@openvz.org>,
Sukadev Bhattiprolu <sukadev@us.ibm.com>,
Linux Containers <containers@lists.osdl.org>
Subject: [PATCH] proc: Simplify and correct proc_flush_task
Date: Fri, 26 Oct 2007 13:43:28 -0600 [thread overview]
Message-ID: <m1r6jhzmov.fsf_-_@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <alpine.LFD.0.999.0710261105440.30120@woody.linux-foundation.org> (Linus Torvalds's message of "Fri, 26 Oct 2007 11:06:52 -0700 (PDT)")
Currently we special case when we have only the initial pid namespace.
Unfortunately in doing so the copied case for the other namespaces was
broken so we don't properly flush the thread directories :(
So this patch removes the unnecessary special case (removing a
usage of proc_mnt) and corrects the flushing of the thread directories.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
fs/proc/base.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index aeaf0d0..a17c268 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2328,21 +2328,18 @@ out:
void proc_flush_task(struct task_struct *task)
{
- int i, leader;
- struct pid *pid, *tgid;
+ int i;
+ struct pid *pid, *tgid = NULL;
struct upid *upid;
- leader = thread_group_leader(task);
- proc_flush_task_mnt(proc_mnt, task->pid, leader ? task->tgid : 0);
pid = task_pid(task);
- if (pid->level == 0)
- return;
+ if (thread_group_leader(task))
+ tgid = task_tgid(task);
- tgid = task_tgid(task);
- for (i = 1; i <= pid->level; i++) {
+ for (i = 0; i <= pid->level; i++) {
upid = &pid->numbers[i];
proc_flush_task_mnt(upid->ns->proc_mnt, upid->nr,
- leader ? 0 : tgid->numbers[i].nr);
+ tgid ? tgid->numbers[i].nr : 0);
}
upid = &pid->numbers[pid->level];
--
1.5.3.rc6.17.g1911
next prev parent reply other threads:[~2007-10-26 19:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 17:48 [PATCH] proc: Fix proc_kill_inodes to kill dentries on all proc superblocks Eric W. Biederman
2007-10-26 18:06 ` Linus Torvalds
2007-10-26 18:36 ` Eric W. Biederman
2007-10-26 19:43 ` Eric W. Biederman [this message]
2007-10-26 20:37 ` [PATCH] pidns: Limit kill -1 and cap_set_all Eric W. Biederman
2007-10-29 8:38 ` Kirill Korotaev
2007-10-29 18:07 ` Eric W. Biederman
2007-10-29 16:02 ` Dave Hansen
2007-10-29 17:59 ` Eric W. Biederman
2007-10-29 18:07 ` Dave Hansen
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=m1r6jhzmov.fsf_-_@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sukadev@us.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@ftp.linux.org.uk \
--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
all inboxes | Powered by JetHome®