diff --git a/[refs] b/[refs] index 1deabea94140..fa00a591b312 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b68e9f857271189bd7a59b74c99890de9195b0e1 +refs/heads/master: 2f60f8d3573ff90fe5d75a6d11fd2add1248e7d6 diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index da3fa90a0aae..404319477e71 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -143,7 +143,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin) leave 3% of the size of this process for other processes */ allowed -= current->mm->total_vm / 32; - if (atomic_read(&vm_committed_space) < allowed) + /* + * cast `allowed' as a signed long because vm_committed_space + * sometimes has a negative value + */ + if (atomic_read(&vm_committed_space) < (long)allowed) return 0; vm_unacct_memory(pages); diff --git a/trunk/mm/nommu.c b/trunk/mm/nommu.c index ce74452c02d9..fd4e8df0f02d 100644 --- a/trunk/mm/nommu.c +++ b/trunk/mm/nommu.c @@ -1167,7 +1167,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin) leave 3% of the size of this process for other processes */ allowed -= current->mm->total_vm / 32; - if (atomic_read(&vm_committed_space) < allowed) + /* + * cast `allowed' as a signed long because vm_committed_space + * sometimes has a negative value + */ + if (atomic_read(&vm_committed_space) < (long)allowed) return 0; vm_unacct_memory(pages);