Actually enforce limit for inheritable resources on fork.

MFC after:	3 days
This commit is contained in:
Edward Tomasz Napierala 2011-10-04 14:56:33 +00:00
parent c6ae748382
commit c0c0936205

View File

@ -567,6 +567,12 @@ racct_proc_fork(struct proc *parent, struct proc *child)
PROC_LOCK(child);
mtx_lock(&racct_lock);
#ifdef RCTL
error = rctl_proc_fork(parent, child);
if (error != 0)
goto out;
#endif
/*
* Inherit resource usage.
*/
@ -581,12 +587,6 @@ racct_proc_fork(struct proc *parent, struct proc *child)
goto out;
}
#ifdef RCTL
error = rctl_proc_fork(parent, child);
if (error != 0)
goto out;
#endif
error = racct_add_locked(child, RACCT_NPROC, 1);
error += racct_add_locked(child, RACCT_NTHR, 1);