From: Alan Cox Signed-off-by: Alan Cox Signed-off-by: Andrew Morton --- fs/proc/array.c | 3 +++ 1 files changed, 3 insertions(+) diff -puN fs/proc/array.c~tty-stop-the-tty-vanishing-under-procfs-access fs/proc/array.c --- a/fs/proc/array.c~tty-stop-the-tty-vanishing-under-procfs-access +++ a/fs/proc/array.c @@ -347,6 +347,8 @@ static int do_task_stat(struct task_stru sigemptyset(&sigign); sigemptyset(&sigcatch); cutime = cstime = utime = stime = cputime_zero; + + mutex_lock(&tty_mutex); read_lock(&tasklist_lock); if (task->sighand) { spin_lock_irq(&task->sighand->siglock); @@ -388,6 +390,7 @@ static int do_task_stat(struct task_stru } ppid = pid_alive(task) ? task->group_leader->real_parent->tgid : 0; read_unlock(&tasklist_lock); + mutex_unlock(&tty_mutex); if (!whole || num_threads<2) wchan = get_wchan(task); _