diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 21:34:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 21:34:42 -0500 |
commit | b6da0076bab5a12afb19312ffee41c95490af2a0 (patch) | |
tree | 52a5675b9c2ff95d88b981d5b9a3822f6073c112 /fs/proc/array.c | |
parent | cbfe0de303a55ed96d8831c2d5f56f8131cd6612 (diff) | |
parent | a53b831549141aa060a8b54b76e3a42870d74cc0 (diff) |
Merge branch 'akpm' (patchbomb from Andrew)
Merge first patchbomb from Andrew Morton:
- a few minor cifs fixes
- dma-debug upadtes
- ocfs2
- slab
- about half of MM
- procfs
- kernel/exit.c
- panic.c tweaks
- printk upates
- lib/ updates
- checkpatch updates
- fs/binfmt updates
- the drivers/rtc tree
- nilfs
- kmod fixes
- more kernel/exit.c
- various other misc tweaks and fixes
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (190 commits)
exit: pidns: fix/update the comments in zap_pid_ns_processes()
exit: pidns: alloc_pid() leaks pid_namespace if child_reaper is exiting
exit: exit_notify: re-use "dead" list to autoreap current
exit: reparent: call forget_original_parent() under tasklist_lock
exit: reparent: avoid find_new_reaper() if no children
exit: reparent: introduce find_alive_thread()
exit: reparent: introduce find_child_reaper()
exit: reparent: document the ->has_child_subreaper checks
exit: reparent: s/while_each_thread/for_each_thread/ in find_new_reaper()
exit: reparent: fix the cross-namespace PR_SET_CHILD_SUBREAPER reparenting
exit: reparent: fix the dead-parent PR_SET_CHILD_SUBREAPER reparenting
exit: proc: don't try to flush /proc/tgid/task/tgid
exit: release_task: fix the comment about group leader accounting
exit: wait: drop tasklist_lock before psig->c* accounting
exit: wait: don't use zombie->real_parent
exit: wait: cleanup the ptrace_reparented() checks
usermodehelper: kill the kmod_thread_locker logic
usermodehelper: don't use CLONE_VFORK for ____call_usermodehelper()
fs/hfs/catalog.c: fix comparison bug in hfs_cat_keycmp
nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races
...
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index cd3653e4f35c..bd117d065b82 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -157,20 +157,29 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns, | |||
157 | struct user_namespace *user_ns = seq_user_ns(m); | 157 | struct user_namespace *user_ns = seq_user_ns(m); |
158 | struct group_info *group_info; | 158 | struct group_info *group_info; |
159 | int g; | 159 | int g; |
160 | struct fdtable *fdt = NULL; | 160 | struct task_struct *tracer; |
161 | const struct cred *cred; | 161 | const struct cred *cred; |
162 | pid_t ppid, tpid; | 162 | pid_t ppid, tpid = 0, tgid, ngid; |
163 | unsigned int max_fds = 0; | ||
163 | 164 | ||
164 | rcu_read_lock(); | 165 | rcu_read_lock(); |
165 | ppid = pid_alive(p) ? | 166 | ppid = pid_alive(p) ? |
166 | task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0; | 167 | task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0; |
167 | tpid = 0; | 168 | |
168 | if (pid_alive(p)) { | 169 | tracer = ptrace_parent(p); |
169 | struct task_struct *tracer = ptrace_parent(p); | 170 | if (tracer) |
170 | if (tracer) | 171 | tpid = task_pid_nr_ns(tracer, ns); |
171 | tpid = task_pid_nr_ns(tracer, ns); | 172 | |
172 | } | 173 | tgid = task_tgid_nr_ns(p, ns); |
174 | ngid = task_numa_group_id(p); | ||
173 | cred = get_task_cred(p); | 175 | cred = get_task_cred(p); |
176 | |||
177 | task_lock(p); | ||
178 | if (p->files) | ||
179 | max_fds = files_fdtable(p->files)->max_fds; | ||
180 | task_unlock(p); | ||
181 | rcu_read_unlock(); | ||
182 | |||
174 | seq_printf(m, | 183 | seq_printf(m, |
175 | "State:\t%s\n" | 184 | "State:\t%s\n" |
176 | "Tgid:\t%d\n" | 185 | "Tgid:\t%d\n" |
@@ -179,12 +188,10 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns, | |||
179 | "PPid:\t%d\n" | 188 | "PPid:\t%d\n" |
180 | "TracerPid:\t%d\n" | 189 | "TracerPid:\t%d\n" |
181 | "Uid:\t%d\t%d\t%d\t%d\n" | 190 | "Uid:\t%d\t%d\t%d\t%d\n" |
182 | "Gid:\t%d\t%d\t%d\t%d\n", | 191 | "Gid:\t%d\t%d\t%d\t%d\n" |
192 | "FDSize:\t%d\nGroups:\t", | ||
183 | get_task_state(p), | 193 | get_task_state(p), |
184 | task_tgid_nr_ns(p, ns), | 194 | tgid, ngid, pid_nr_ns(pid, ns), ppid, tpid, |
185 | task_numa_group_id(p), | ||
186 | pid_nr_ns(pid, ns), | ||
187 | ppid, tpid, | ||
188 | from_kuid_munged(user_ns, cred->uid), | 195 | from_kuid_munged(user_ns, cred->uid), |
189 | from_kuid_munged(user_ns, cred->euid), | 196 | from_kuid_munged(user_ns, cred->euid), |
190 | from_kuid_munged(user_ns, cred->suid), | 197 | from_kuid_munged(user_ns, cred->suid), |
@@ -192,20 +199,10 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns, | |||
192 | from_kgid_munged(user_ns, cred->gid), | 199 | from_kgid_munged(user_ns, cred->gid), |
193 | from_kgid_munged(user_ns, cred->egid), | 200 | from_kgid_munged(user_ns, cred->egid), |
194 | from_kgid_munged(user_ns, cred->sgid), | 201 | from_kgid_munged(user_ns, cred->sgid), |
195 | from_kgid_munged(user_ns, cred->fsgid)); | 202 | from_kgid_munged(user_ns, cred->fsgid), |
196 | 203 | max_fds); | |
197 | task_lock(p); | ||
198 | if (p->files) | ||
199 | fdt = files_fdtable(p->files); | ||
200 | seq_printf(m, | ||
201 | "FDSize:\t%d\n" | ||
202 | "Groups:\t", | ||
203 | fdt ? fdt->max_fds : 0); | ||
204 | rcu_read_unlock(); | ||
205 | 204 | ||
206 | group_info = cred->group_info; | 205 | group_info = cred->group_info; |
207 | task_unlock(p); | ||
208 | |||
209 | for (g = 0; g < group_info->ngroups; g++) | 206 | for (g = 0; g < group_info->ngroups; g++) |
210 | seq_printf(m, "%d ", | 207 | seq_printf(m, "%d ", |
211 | from_kgid_munged(user_ns, GROUP_AT(group_info, g))); | 208 | from_kgid_munged(user_ns, GROUP_AT(group_info, g))); |