Fix commented out resource limit check in mlockall(2). It's still racy,

but at least less misleading.
This commit is contained in:
Edward Tomasz Napierala 2010-07-27 19:26:18 +00:00
parent ee37b5e791
commit fd6f4ffb27

View file

@ -1082,8 +1082,7 @@ mlockall(td, uap)
* a hard resource limit, return ENOMEM.
*/
PROC_LOCK(td->td_proc);
if (map->size - ptoa(pmap_wired_count(vm_map_pmap(map)) >
lim_cur(td->td_proc, RLIMIT_MEMLOCK))) {
if (map->size > lim_cur(td->td_proc, RLIMIT_MEMLOCK)) {
PROC_UNLOCK(td->td_proc);
return (ENOMEM);
}