Re: oops in proc_pid_stat() on task->real_parent?

From: Dinakar Guniguntala
Date: Wed Dec 08 2004 - 02:54:32 EST


On Tue, Dec 07, 2004 at 10:07:55PM -0800, Chris Wright wrote:
> * Andrew Morton (akpm@xxxxxxxx) wrote:
> > yup, we fixed that one.
>
> I thought the same thing, but this oops is from proc_pid_stat, not
> proc_pid_status. The code is now in do_task_stat(), and the oops is
> within the orignal tasklist lock (instead of dropping and reaquiring the
> lock). So, might be fixed, but if so, I think for a different reason.
>
> thanks,
> -chris

hmmm they were two places that I had changed to reflect the parent.

This should fix it?

Signed-off-by: Dinakar Guniguntala <dino@xxxxxxxxxx>


diff -Naurp linux-2.6.10-rc2.orig/fs/proc/array.c linux-2.6.10-rc2/fs/proc/array.c
--- linux-2.6.10-rc2.orig/fs/proc/array.c 2004-11-15 06:57:52.000000000 +0530
+++ linux-2.6.10-rc2/fs/proc/array.c 2004-12-08 12:54:40.000000000 +0530
@@ -370,7 +370,7 @@ static int do_task_stat(struct task_stru
stime += task->signal->stime;
}
}
- ppid = task->pid ? task->group_leader->real_parent->tgid : 0;
+ ppid = pid_alive(task) ? task->group_leader->real_parent->tgid : 0;
read_unlock(&tasklist_lock);

if (!whole || num_threads<2)