Actually enforce limit for inheritable resources on fork.
MFC after: 3 days
This commit is contained in:
parent
c6ae748382
commit
c0c0936205
@ -567,6 +567,12 @@ racct_proc_fork(struct proc *parent, struct proc *child)
|
|||||||
PROC_LOCK(child);
|
PROC_LOCK(child);
|
||||||
mtx_lock(&racct_lock);
|
mtx_lock(&racct_lock);
|
||||||
|
|
||||||
|
#ifdef RCTL
|
||||||
|
error = rctl_proc_fork(parent, child);
|
||||||
|
if (error != 0)
|
||||||
|
goto out;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Inherit resource usage.
|
* Inherit resource usage.
|
||||||
*/
|
*/
|
||||||
@ -581,12 +587,6 @@ racct_proc_fork(struct proc *parent, struct proc *child)
|
|||||||
goto out;
|
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_NPROC, 1);
|
||||||
error += racct_add_locked(child, RACCT_NTHR, 1);
|
error += racct_add_locked(child, RACCT_NTHR, 1);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user