diff options
author | trociny <trociny@FreeBSD.org> | 2011-11-07 21:09:04 +0000 |
---|---|---|
committer | trociny <trociny@FreeBSD.org> | 2011-11-07 21:09:04 +0000 |
commit | f25b803473a0f1771f7f9c030ab431ac4d3f51c6 (patch) | |
tree | 6bce67bd7315093e2e335f21265eb57aae95a34b | |
parent | 518d5f51525d8e01b4befcc3f659020f16f76d4c (diff) | |
download | FreeBSD-src-f25b803473a0f1771f7f9c030ab431ac4d3f51c6.zip FreeBSD-src-f25b803473a0f1771f7f9c030ab431ac4d3f51c6.tar.gz |
In lim_fork() assert that processes locks are held.
Suggested by: kib
-rw-r--r-- | sys/kern/kern_resource.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index e6e8021..0a36772 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1118,6 +1118,10 @@ lim_hold(limp) void lim_fork(struct proc *p1, struct proc *p2) { + + PROC_LOCK_ASSERT(p1, MA_OWNED); + PROC_LOCK_ASSERT(p2, MA_OWNED); + p2->p_limit = lim_hold(p1->p_limit); callout_init_mtx(&p2->p_limco, &p2->p_mtx, 0); if (p1->p_cpulimit != RLIM_INFINITY) |