Merge to Fedora kernel-2.6.18-1.2239_FC5 patched with stable patch-2.6.18.2-vs2.0...
[linux-2.6.git] / fs / proc / array.c
index 715194f..765cc29 100644 (file)
@@ -408,6 +408,8 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
        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);
@@ -453,6 +455,7 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
        pgid = vx_info_map_pid(task->vx_info, pgid);
 
        read_unlock(&tasklist_lock);
+       mutex_unlock(&tty_mutex);
 
        if (!whole || num_threads<2) {
                wchan = 0;