diff options
-rw-r--r-- | 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 aeaf0d0f2f51..a17c26859074 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2328,21 +2328,18 @@ out: | |||
2328 | 2328 | ||
2329 | void proc_flush_task(struct task_struct *task) | 2329 | void 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]; |