aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index b5810c228c10..7c8d9aecb070 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -157,9 +157,9 @@ 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;
161 const struct cred *cred; 160 const struct cred *cred;
162 pid_t ppid, tpid; 161 pid_t ppid, tpid;
162 unsigned int max_fds = 0;
163 163
164 rcu_read_lock(); 164 rcu_read_lock();
165 ppid = pid_alive(p) ? 165 ppid = pid_alive(p) ?
@@ -171,6 +171,12 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
171 tpid = task_pid_nr_ns(tracer, ns); 171 tpid = task_pid_nr_ns(tracer, ns);
172 } 172 }
173 cred = get_task_cred(p); 173 cred = get_task_cred(p);
174
175 task_lock(p);
176 if (p->files)
177 max_fds = files_fdtable(p->files)->max_fds;
178 task_unlock(p);
179
174 seq_printf(m, 180 seq_printf(m,
175 "State:\t%s\n" 181 "State:\t%s\n"
176 "Tgid:\t%d\n" 182 "Tgid:\t%d\n"
@@ -179,7 +185,8 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
179 "PPid:\t%d\n" 185 "PPid:\t%d\n"
180 "TracerPid:\t%d\n" 186 "TracerPid:\t%d\n"
181 "Uid:\t%d\t%d\t%d\t%d\n" 187 "Uid:\t%d\t%d\t%d\t%d\n"
182 "Gid:\t%d\t%d\t%d\t%d\n", 188 "Gid:\t%d\t%d\t%d\t%d\n"
189 "FDSize:\t%d\nGroups:\t",
183 get_task_state(p), 190 get_task_state(p),
184 task_tgid_nr_ns(p, ns), 191 task_tgid_nr_ns(p, ns),
185 task_numa_group_id(p), 192 task_numa_group_id(p),
@@ -192,16 +199,8 @@ 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 task_unlock(p);
205 rcu_read_unlock(); 204 rcu_read_unlock();
206 205
207 group_info = cred->group_info; 206 group_info = cred->group_info;