pidns: fix free_pid() to handle the first fork failure
authorOleg Nesterov <oleg@redhat.com>
Mon, 30 Sep 2013 20:45:27 +0000 (13:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 30 Sep 2013 21:31:03 +0000 (14:31 -0700)
commit314a8ad0f18ac37887896b288939acd8cb17e208
tree3afb94a4d82371f2ffda08e88c45be09fbaec3ba
parent4271b05a227dc6175b66c3d9941aeab09048aeb2
pidns: fix free_pid() to handle the first fork failure

"case 0" in free_pid() assumes that disable_pid_allocation() should
clear PIDNS_HASH_ADDING before the last pid goes away.

However this doesn't happen if the first fork() fails to create the
child reaper which should call disable_pid_allocation().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/pid.c