Re: [PATCH rc1-mm] simplify exec from init's subthread

From: Eric W. Biederman
Date: Wed Feb 01 2006 - 23:58:41 EST


Oleg Nesterov <oleg@xxxxxxxxxx> writes:

> [ On top of "exec: allow init to exec from any thread.",
> filename exec-allow-init-to-exec-from-any-thread.patch ]
>
> I think it is enough to take tasklist_lock for reading while
> changing child_reaper:
>
> Reparenting needs write_lock(tasklist_lock)
>
> Only one thread in a thread group can do exec()
>
> sighand->siglock garantees that get_signal_to_deliver()
> will not see a stale value of child_reaper.
>
> This means that we can change child_reaper earlier, without
> calling zap_other_threads() twice.
>
> "child_reaper = current" is a NOOP when init does exec from
> main thread, we don't care.

Looks good. I fat fingered my locking anyway, and this
looks like a good fix, as well as the more obvious place,
to do this.

Acked-by: Eric Biederman <ebiederm@xxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/