[PATCH 2/4] mlockall() check rlimit only when MCL_CURRENT is set

From: Chris Wright
Date: Wed Sep 29 2004 - 13:55:09 EST


Only check memlock rlimit against mm->total_vm when mlockall() flags
include MCL_CURRENT.

Signed-off-by: Chris Wright <chrisw@xxxxxxxx>

--- 2.6.9-rc2/mm/mlock.c~mcl_current_acct 2004-09-28 15:00:48.962235080 -0700
+++ 2.6.9-rc2/mm/mlock.c 2004-09-28 15:03:35.192964168 -0700
@@ -178,7 +178,8 @@ asmlinkage long sys_mlockall(int flags)
lock_limit >>= PAGE_SHIFT;

ret = -ENOMEM;
- if ((current->mm->total_vm <= lock_limit) || capable(CAP_IPC_LOCK))
+ if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) ||
+ capable(CAP_IPC_LOCK))
ret = do_mlockall(flags);
out:
up_write(&current->mm->mmap_sem);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/