Skip to contentSkip to conversation

wait_task_zombie plus WNOWAIT question

DISCUSSION Vitaly Mayatskikh 2 participants 3 messages Jul 1, 2009

lore
Share & tools
lore
#0 lore raw

Hi!

I'm working on (sigh) next version of wait_task_* cleanups and stuck in wait_task_zombie. I'm trying to move put_user(stat, wo->wo_stat) code from all wait_task_* functions to common place, but wait_task_zombie does not fill wo_stat if WNOWAIT flag is set and does it w/o that flag. Is it done so by design, or I can make user-visible change and add put_user in WNOWAIT path?

Thanks!

Signature · 1 line
wbr, Vitaly
#1 lore raw
Quoted 5 lines · Vitaly Mayatskikh

I'm working on (sigh) next version of wait_task_* cleanups and stuck in wait_task_zombie. I'm trying to move put_user(stat, wo->wo_stat) code from all wait_task_* functions to common place, but wait_task_zombie does not fill wo_stat if WNOWAIT flag is set

Only waitid() can use WNOWAIT, and in this case ->wo_stat == NULL.

Quoted 3 lines

and does
it w/o that flag. Is it done so by design, or I can make user-visible change and add put_user in WNOWAIT path?

Just check do not do put_user(->wo_stat) if it is NULL in do_wait pathes.

Oleg.

#2 lore raw
Quoted 8 lines · Oleg Nesterov
Quoted 5 lines · Vitaly Mayatskikh

I'm working on (sigh) next version of wait_task_* cleanups and stuck in wait_task_zombie. I'm trying to move put_user(stat, wo->wo_stat) code from all wait_task_* functions to common place, but wait_task_zombie does not fill wo_stat if WNOWAIT flag is set

Quoted 8 lines

Only waitid() can use WNOWAIT, and in this case ->wo_stat == NULL.

Quoted 3 lines

and does
it w/o that flag. Is it done so by design, or I can make user-visible change and add put_user in WNOWAIT path?

Just check do not do put_user(->wo_stat) if it is NULL in do_wait pathes.

Got it! Thanks, Oleg!

Signature · 1 line
wbr, Vitaly