Re: Fw: 2.5.61 oops running SDET

Linus Torvalds
2003-02-16T02:21:02Z

On Sat, 15 Feb 2003, Martin J. Bligh wrote:
>
> Something like this? Compiles, but not tested yet ...

Close, but you also need

- buffer = task_sig(task, buffer);
+ if (task->sighand)
+ buffer = task_sig(task, buffer);

to actually check whether signals exist or not. Otherwise you'll just get
the same oops anyway (well, keeping the task locked may change timings
enough that it doesn't happen, but the bug will continue to be there.

I would also say that since you explicitly take the task lock, there's no
real reason to use "get_task_mm()" at all any more, so instead of doing
that (and then doing the mmput()), just get rid of the mm variable
entirely, and do

if (task->mm)
buffer = task_mem(task->mm, buffer)

too. There's really no downside to just holding on to the task lock over
the whole operation instead of incrementing and decrementing the mm
counts and dropping the lock early.

(There are a few valid reasons for using the "get_task_mm()" function:

- you need to block and thus drop the task lock

- the original code just used "task->mm" directly, and using
"get_task_mm()" made the original conversion to mm safe handling
easier.

Neither reason is really valid any more in this function at least).

Linus