aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c2
-rw-r--r--fs/proc/base.c9
2 files changed, 1 insertions, 10 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 71c9be59c9c2..1c8d7b5d7a14 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -261,7 +261,6 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
261 sigemptyset(&ignored); 261 sigemptyset(&ignored);
262 sigemptyset(&caught); 262 sigemptyset(&caught);
263 263
264 rcu_read_lock();
265 if (lock_task_sighand(p, &flags)) { 264 if (lock_task_sighand(p, &flags)) {
266 pending = p->pending.signal; 265 pending = p->pending.signal;
267 shpending = p->signal->shared_pending.signal; 266 shpending = p->signal->shared_pending.signal;
@@ -272,7 +271,6 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
272 qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur; 271 qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur;
273 unlock_task_sighand(p, &flags); 272 unlock_task_sighand(p, &flags);
274 } 273 }
275 rcu_read_unlock();
276 274
277 seq_printf(m, "Threads:\t%d\n", num_threads); 275 seq_printf(m, "Threads:\t%d\n", num_threads);
278 seq_printf(m, "SigQ:\t%lu/%lu\n", qsize, qlim); 276 seq_printf(m, "SigQ:\t%lu/%lu\n", qsize, qlim);
diff --git a/fs/proc/base.c b/fs/proc/base.c
index a28840b11b89..bb63fa1d34a2 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -164,7 +164,6 @@ static struct fs_struct *get_fs_struct(struct task_struct *task)
164 164
165static int get_nr_threads(struct task_struct *tsk) 165static int get_nr_threads(struct task_struct *tsk)
166{ 166{
167 /* Must be called with the rcu_read_lock held */
168 unsigned long flags; 167 unsigned long flags;
169 int count = 0; 168 int count = 0;
170 169
@@ -471,14 +470,10 @@ static int proc_pid_limits(struct task_struct *task, char *buffer)
471 470
472 struct rlimit rlim[RLIM_NLIMITS]; 471 struct rlimit rlim[RLIM_NLIMITS];
473 472
474 rcu_read_lock(); 473 if (!lock_task_sighand(task, &flags))
475 if (!lock_task_sighand(task,&flags)) {
476 rcu_read_unlock();
477 return 0; 474 return 0;
478 }
479 memcpy(rlim, task->signal->rlim, sizeof(struct rlimit) * RLIM_NLIMITS); 475 memcpy(rlim, task->signal->rlim, sizeof(struct rlimit) * RLIM_NLIMITS);
480 unlock_task_sighand(task, &flags); 476 unlock_task_sighand(task, &flags);
481 rcu_read_unlock();
482 477
483 /* 478 /*
484 * print the file header 479 * print the file header
@@ -3088,9 +3083,7 @@ static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
3088 generic_fillattr(inode, stat); 3083 generic_fillattr(inode, stat);
3089 3084
3090 if (p) { 3085 if (p) {
3091 rcu_read_lock();
3092 stat->nlink += get_nr_threads(p); 3086 stat->nlink += get_nr_threads(p);
3093 rcu_read_unlock();
3094 put_task_struct(p); 3087 put_task_struct(p);
3095 } 3088 }
3096 3089