Now that get_utrace_lock() can never succeed if utrace->reap is true, we can kill this check in utrace_set_events(). This also means we can kill the target->exit_state check, it buys nothing now.
Signed-off-by: Oleg Nesterov <o...@redhat.com> --- kernel/utrace.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) --- kstub/kernel/utrace.c~7_set_events_kill_reap 2010-08-16 11:17:51.000000000 +0200 +++ kstub/kernel/utrace.c 2010-08-16 11:28:00.000000000 +0200 @@ -539,15 +539,10 @@ int utrace_set_events(struct task_struct old_utrace_flags = target->utrace_flags; old_flags = engine->flags & ~ENGINE_STOP; - /* If ->death or ->reap is true we must see exit_state != 0. */ - if (target->exit_state) { - if (utrace->death) { - if ((old_flags & ~events) & _UTRACE_DEATH_EVENTS) - goto unlock; - } else if (utrace->reap) { - if ((old_flags ^ events) & UTRACE_EVENT(REAP)) - goto unlock; - } + if ((old_flags & ~events) & _UTRACE_DEATH_EVENTS) { + /* Too late if utrace_report_death() is in progress */ + if (utrace->death) + goto unlock; } /*