mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
proc: simplify and correct proc_flush_task
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> Cc: Al Viro <viro@ftp.linux.org.uk> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Cc: Kirill Korotaev <dev@sw.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c0f2a9d75a
commit
9fcc2d15b1
1 changed files with 6 additions and 9 deletions
|
@ -2328,21 +2328,18 @@ static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid)
|
|||
|
||||
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];
|
||||
|
|
Loading…
Reference in a new issue