aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-11-14 20:00:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-14 21:45:42 -0500
commit9fcc2d15b14894aa53e5e8b7fd5d6e3ca558e5df (patch)
treebc58ea7711b0a51c5b810ca1320fed53ed201772 /fs
parentc0f2a9d75aed1a4be40c3975b94fd39066bd11bb (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/base.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index aeaf0d0f2f51..a17c26859074 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2328,21 +2328,18 @@ out:
2328 2328
2329void proc_flush_task(struct task_struct *task) 2329void proc_flush_task(struct task_struct *task)
2330{ 2330{
2331 int i, leader; 2331 int i;
2332 struct pid *pid, *tgid; 2332 struct pid *pid, *tgid = NULL;
2333 struct upid *upid; 2333 struct upid *upid;
2334 2334
2335 leader = thread_group_leader(task);
2336 proc_flush_task_mnt(proc_mnt, task->pid, leader ? task->tgid : 0);
2337 pid = task_pid(task); 2335 pid = task_pid(task);
2338 if (pid->level == 0) 2336 if (thread_group_leader(task))
2339 return; 2337 tgid = task_tgid(task);
2340 2338
2341 tgid = task_tgid(task); 2339 for (i = 0; i <= pid->level; i++) {
2342 for (i = 1; i <= pid->level; i++) {
2343 upid = &pid->numbers[i]; 2340 upid = &pid->numbers[i];
2344 proc_flush_task_mnt(upid->ns->proc_mnt, upid->nr, 2341 proc_flush_task_mnt(upid->ns->proc_mnt, upid->nr,
2345 leader ? 0 : tgid->numbers[i].nr); 2342 tgid ? tgid->numbers[i].nr : 0);
2346 } 2343 }
2347 2344
2348 upid = &pid->numbers[pid->level]; 2345 upid = &pid->numbers[pid->level];