X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mm%2Fmmap.c;h=404319477e71d61679166bc954ed246719affe89;hb=11d31886dbcb61039ed3789e583d21c6e70960fd;hp=da3fa90a0aae2b9af04ec553209deb6a51b80b48;hpb=f45727d52d1581e9ff4df9d1a12a60789ad2d1eb;p=linux-2.6 diff --git a/mm/mmap.c b/mm/mmap.c index da3fa90a0a..404319477e 100644 --- a/mm/mmap.c +++ b/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);