PERFORCE change 156305 for review
Robert Watson
rwatson at FreeBSD.org
Sat Jan 17 14:38:16 PST 2009
http://perforce.freebsd.org/chv.cgi?CH=156305
Change 156305 by rwatson at rwatson_freebsd_capabilities on 2009/01/17 22:38:00
When creating a process descriptor for a process, hook it up so that
it can be found later.
Assert that a process descriptor is closed before freeing it.
Affected files ...
.. //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_procdesc.c#2 edit
Differences ...
==== //depot/projects/trustedbsd/capabilities/src/sys/kern/sys_procdesc.c#2 (text+ko) ====
@@ -208,6 +208,7 @@
pd = uma_zalloc(procdesc_zone, M_WAITOK | M_ZERO);
pd->pd_proc = p;
pd->pd_pid = p->p_pid;
+ p->p_procdesc = pd;
/*
* Process descriptors start out with two references: one from their
@@ -226,6 +227,8 @@
if (refcount_release(&pd->pd_refcount)) {
KASSERT(pd->pd_proc == NULL,
("procdesc_free: pd_proc != NULL"));
+ KASSERT((pd->pd_flags & PD_CLOSED),
+ ("procdesc_free: !PD_CLOSED"));
uma_zfree(procdesc_zone, pd);
}
More information about the p4-projects
mailing list