On 02/25, Oleg Nesterov wrote:
>
> On 02/24, Andrei Vagin wrote:
> >
> > This isn't directly related to this patch, but why do we check
> > "ns->pid_allocated & PIDNS_ADDING" after allocating all pids?  Wouldn't
> > it be more reasonable to do that right after taking the pidmap_lock?
>
> Perhaps, but alloc_pid() can drop pidmap_lock and retry, so we will
> need to re-check PIDNS_ADDING.

Now that I look at this code again... Why do we bother to check
"pid_allocated & PIDNS_ADDING" at all? copy_process() does

        /* Don't start children in a dying pid namespace */
        if (unlikely(!(ns_of_pid(pid)->pid_allocated & PIDNS_ADDING))) {
                retval = -ENOMEM;
                goto bad_fork_core_free;
        }

I am going to send the patch which removes this check from alloc_pid...
Need to recheck.

Oleg.


Reply via email to