Messages in this thread | | | Date | Sun, 8 Sep 2013 19:56:02 +0200 | From | Oleg Nesterov <> | Subject | Re: [REVIEW][PATCH] pidns: Fix hang in zap_pid_ns_processes by sending a potentially extra wakeup |
| |
Sorry for delay, vacation.
On 08/30, Eric W. Biederman wrote: > > --- a/kernel/pid.c > +++ b/kernel/pid.c > @@ -265,6 +265,7 @@ void free_pid(struct pid *pid) > struct pid_namespace *ns = upid->ns; > hlist_del_rcu(&upid->pid_chain); > switch(--ns->nr_hashed) { > + case 2: > case 1: > /* When all that is left in the pid namespace > * is the reaper wake up the reaper. The reaper
I think the patch is fine, and this matches "init_pids" in zap_pid_ns_processes().
But, Eric, if this patch was not applied yet, any chance you can add a comment ? Just a little note about the potential zombie leader can help to understand this code. I won't insist of course, but this "case 2" doesn't look obvious.
Off topic. What if the first alloc_pid() succeeds and then later copy_process() fails. In this case free_pid() is called but PIDNS_HASH_ADDING was not cleared, we miss kern_unmount(), no?
Oleg.
| |