diff options
-rw-r--r-- | fs/proc/array.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 25e917fb4739..b0cd014a39bd 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -346,20 +346,13 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) | |||
346 | sigemptyset(&sigcatch); | 346 | sigemptyset(&sigcatch); |
347 | cutime = cstime = utime = stime = cputime_zero; | 347 | cutime = cstime = utime = stime = cputime_zero; |
348 | 348 | ||
349 | mutex_lock(&tty_mutex); | ||
350 | rcu_read_lock(); | 349 | rcu_read_lock(); |
351 | if (lock_task_sighand(task, &flags)) { | 350 | if (lock_task_sighand(task, &flags)) { |
352 | struct signal_struct *sig = task->signal; | 351 | struct signal_struct *sig = task->signal; |
353 | struct tty_struct *tty = sig->tty; | 352 | |
354 | 353 | if (sig->tty) { | |
355 | if (tty) { | 354 | tty_pgrp = sig->tty->pgrp; |
356 | /* | 355 | tty_nr = new_encode_dev(tty_devnum(sig->tty)); |
357 | * sig->tty is not stable, but tty_mutex | ||
358 | * protects us from release_dev(tty) | ||
359 | */ | ||
360 | barrier(); | ||
361 | tty_pgrp = tty->pgrp; | ||
362 | tty_nr = new_encode_dev(tty_devnum(tty)); | ||
363 | } | 356 | } |
364 | 357 | ||
365 | num_threads = atomic_read(&sig->count); | 358 | num_threads = atomic_read(&sig->count); |
@@ -395,7 +388,6 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) | |||
395 | unlock_task_sighand(task, &flags); | 388 | unlock_task_sighand(task, &flags); |
396 | } | 389 | } |
397 | rcu_read_unlock(); | 390 | rcu_read_unlock(); |
398 | mutex_unlock(&tty_mutex); | ||
399 | 391 | ||
400 | if (!whole || num_threads<2) | 392 | if (!whole || num_threads<2) |
401 | wchan = get_wchan(task); | 393 | wchan = get_wchan(task); |