Commit 74b2d0c0 authored by Chris Wright's avatar Chris Wright Committed by Linus Torvalds

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

Only check memlock rlimit against mm->total_vm when mlockall() flags
include MCL_CURRENT.
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9a01ab03
...@@ -178,7 +178,8 @@ asmlinkage long sys_mlockall(int flags) ...@@ -178,7 +178,8 @@ asmlinkage long sys_mlockall(int flags)
lock_limit >>= PAGE_SHIFT; lock_limit >>= PAGE_SHIFT;
ret = -ENOMEM; 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); ret = do_mlockall(flags);
out: out:
up_write(&current->mm->mmap_sem); up_write(&current->mm->mmap_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment