diff options
| -rw-r--r-- | fs/proc/array.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 35bd39dac247..25e917fb4739 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
| @@ -162,7 +162,7 @@ static inline char * task_state(struct task_struct *p, char *buffer) | |||
| 162 | int g; | 162 | int g; |
| 163 | struct fdtable *fdt = NULL; | 163 | struct fdtable *fdt = NULL; |
| 164 | 164 | ||
| 165 | read_lock(&tasklist_lock); | 165 | rcu_read_lock(); |
| 166 | buffer += sprintf(buffer, | 166 | buffer += sprintf(buffer, |
| 167 | "State:\t%s\n" | 167 | "State:\t%s\n" |
| 168 | "SleepAVG:\t%lu%%\n" | 168 | "SleepAVG:\t%lu%%\n" |
| @@ -174,14 +174,13 @@ static inline char * task_state(struct task_struct *p, char *buffer) | |||
| 174 | "Gid:\t%d\t%d\t%d\t%d\n", | 174 | "Gid:\t%d\t%d\t%d\t%d\n", |
| 175 | get_task_state(p), | 175 | get_task_state(p), |
| 176 | (p->sleep_avg/1024)*100/(1020000000/1024), | 176 | (p->sleep_avg/1024)*100/(1020000000/1024), |
| 177 | p->tgid, | 177 | p->tgid, p->pid, |
| 178 | p->pid, pid_alive(p) ? p->group_leader->real_parent->tgid : 0, | 178 | pid_alive(p) ? rcu_dereference(p->real_parent)->tgid : 0, |
| 179 | pid_alive(p) && p->ptrace ? p->parent->pid : 0, | 179 | pid_alive(p) && p->ptrace ? rcu_dereference(p->parent)->pid : 0, |
| 180 | p->uid, p->euid, p->suid, p->fsuid, | 180 | p->uid, p->euid, p->suid, p->fsuid, |
| 181 | p->gid, p->egid, p->sgid, p->fsgid); | 181 | p->gid, p->egid, p->sgid, p->fsgid); |
| 182 | read_unlock(&tasklist_lock); | 182 | |
| 183 | task_lock(p); | 183 | task_lock(p); |
| 184 | rcu_read_lock(); | ||
| 185 | if (p->files) | 184 | if (p->files) |
| 186 | fdt = files_fdtable(p->files); | 185 | fdt = files_fdtable(p->files); |
| 187 | buffer += sprintf(buffer, | 186 | buffer += sprintf(buffer, |
