kernel: Don't disturb about-to-be reaped zombies.
authorYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Fri, 27 May 2011 13:27:39 +0000 (22:27 +0900)
committerYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Fri, 27 May 2011 13:27:39 +0000 (22:27 +0900)
Processes in zombproc with p_nthreads == 0 are about to be reaped,
so just leave them in peace.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1996>

sys/kern/kern_proc.c

index cb067f0..c4d6eb6 100644 (file)
@@ -949,6 +949,11 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS)
 
                        if (!PRISON_CHECK(cr1, p->p_ucred))
                                continue;
+
+                       /* let dying zombies reaped quietly */
+                       if (doingzomb && p->p_nthreads == 0)
+                               continue;
+
                        PHOLD(p);
                        error = sysctl_out_proc(p, req, flags);
                        PRELE(p);