提交 130f77ec 编写于 作者: P Pavel Emelyanov 提交者: Linus Torvalds

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: NPavel 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 30e49c26
......@@ -2259,8 +2259,22 @@ static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid)
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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册