diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-03-05 16:41:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:24 -0500 |
commit | 59e99e5b9706867f18d4a36c1e4645fbaacbec2e (patch) | |
tree | e977fb5eecccf1446296fd196072bd1287b0a92f /mm/mremap.c | |
parent | 06f9d8c2b50060543fb6e0af87ddb86e654dee6b (diff) |
mm: use rlimit helpers
Make sure compiler won't do weird things with limits. E.g. fetching them
twice may return 2 different values after writable limits are implemented.
I.e. either use rlimit helpers added in
3e10e716abf3c71bdb5d86b8f507f9e72236c9cd ("resource: add helpers for
fetching rlimits") or ACCESS_ONCE if not applicable.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mremap.c')
-rw-r--r-- | mm/mremap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mremap.c b/mm/mremap.c index 845190898d59..4c4c803453f3 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -285,7 +285,7 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr, | |||
285 | if (vma->vm_flags & VM_LOCKED) { | 285 | if (vma->vm_flags & VM_LOCKED) { |
286 | unsigned long locked, lock_limit; | 286 | unsigned long locked, lock_limit; |
287 | locked = mm->locked_vm << PAGE_SHIFT; | 287 | locked = mm->locked_vm << PAGE_SHIFT; |
288 | lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur; | 288 | lock_limit = rlimit(RLIMIT_MEMLOCK); |
289 | locked += new_len - old_len; | 289 | locked += new_len - old_len; |
290 | if (locked > lock_limit && !capable(CAP_IPC_LOCK)) | 290 | if (locked > lock_limit && !capable(CAP_IPC_LOCK)) |
291 | goto Eagain; | 291 | goto Eagain; |