aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index c0e554971df0..279fbf542c88 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -244,6 +244,7 @@ static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *ign,
244 244
245static inline char * task_sig(struct task_struct *p, char *buffer) 245static inline char * task_sig(struct task_struct *p, char *buffer)
246{ 246{
247 unsigned long flags;
247 sigset_t pending, shpending, blocked, ignored, caught; 248 sigset_t pending, shpending, blocked, ignored, caught;
248 int num_threads = 0; 249 int num_threads = 0;
249 unsigned long qsize = 0; 250 unsigned long qsize = 0;
@@ -255,10 +256,8 @@ static inline char * task_sig(struct task_struct *p, char *buffer)
255 sigemptyset(&ignored); 256 sigemptyset(&ignored);
256 sigemptyset(&caught); 257 sigemptyset(&caught);
257 258
258 /* Gather all the data with the appropriate locks held */ 259 rcu_read_lock();
259 read_lock(&tasklist_lock); 260 if (lock_task_sighand(p, &flags)) {
260 if (p->sighand) {
261 spin_lock_irq(&p->sighand->siglock);
262 pending = p->pending.signal; 261 pending = p->pending.signal;
263 shpending = p->signal->shared_pending.signal; 262 shpending = p->signal->shared_pending.signal;
264 blocked = p->blocked; 263 blocked = p->blocked;
@@ -266,9 +265,9 @@ static inline char * task_sig(struct task_struct *p, char *buffer)
266 num_threads = atomic_read(&p->signal->count); 265 num_threads = atomic_read(&p->signal->count);
267 qsize = atomic_read(&p->user->sigpending); 266 qsize = atomic_read(&p->user->sigpending);
268 qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur; 267 qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur;
269 spin_unlock_irq(&p->sighand->siglock); 268 unlock_task_sighand(p, &flags);
270 } 269 }
271 read_unlock(&tasklist_lock); 270 rcu_read_unlock();
272 271
273 buffer += sprintf(buffer, "Threads:\t%d\n", num_threads); 272 buffer += sprintf(buffer, "Threads:\t%d\n", num_threads);
274 buffer += sprintf(buffer, "SigQ:\t%lu/%lu\n", qsize, qlim); 273 buffer += sprintf(buffer, "SigQ:\t%lu/%lu\n", qsize, qlim);