diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-19 08:40:11 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 20:53:39 +0200 |
commit | 130f77ecb2e7d5ac3e53e620f55e374f4a406b20 (patch) | |
tree | 3ae9670713a2f503faee3f77666a10dadbe87920 /fs/proc/base.c | |
parent | pid namespaces: allow cloning of new namespace (diff) | |
download | linux-130f77ecb2e7d5ac3e53e620f55e374f4a406b20.tar.xz linux-130f77ecb2e7d5ac3e53e620f55e374f4a406b20.zip |
pid namespaces: make proc_flush_task() actually from entries from multiple namespaces
This means that proc_flush_task_mnt() is to be called for many proc mounts and
with different ids, depending on the namespace this pid is to be flushed from.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Paul Menage <menage@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | fs/proc/base.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 50e149e08d96..5e0c6a1ce8b3 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2259,8 +2259,22 @@ out: void proc_flush_task(struct task_struct *task) { - proc_flush_task_mnt(proc_mnt, task->pid, - thread_group_leader(task) ? 0 : task->tgid); + int i, leader; + struct pid *pid, *tgid; + 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; + + tgid = task_tgid(task); + for (i = 1; i <= pid->level; i++) { + upid = &pid->numbers[i]; + proc_flush_task_mnt(upid->ns->proc_mnt, upid->nr, + leader ? 0 : tgid->numbers[i].nr); + } } static struct dentry *proc_pid_instantiate(struct inode *dir, |