summaryrefslogtreecommitdiffstats
path: root/mm/nommu.c
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2014-01-23 21:52:06 +0100
committerPaul Moore <pmoore@redhat.com>2014-01-23 21:52:06 +0100
commit41be702a542a0d14bb0b1c16e824fa9ed27616ec (patch)
treee48942a05882da47544e179c6a0c920e00137a6a /mm/nommu.c
parentSELinux: Fix memory leak upon loading policy (diff)
parentLinux 3.13 (diff)
downloadlinux-41be702a542a0d14bb0b1c16e824fa9ed27616ec.tar.xz
linux-41be702a542a0d14bb0b1c16e824fa9ed27616ec.zip
Merge tag 'v3.13' into next
Linux 3.13 Minor fixup needed in selinux_inet_conn_request() Conflicts: security/selinux/hooks.c
Diffstat (limited to 'mm/nommu.c')
-rw-r--r--mm/nommu.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index ecd1f158548e..fec093adad9c 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -937,7 +937,7 @@ static int validate_mmap_request(struct file *file,
struct address_space *mapping;
/* files must support mmap */
- if (!file->f_op || !file->f_op->mmap)
+ if (!file->f_op->mmap)
return -ENODEV;
/* work out if what we've got could possibly be shared
@@ -1948,13 +1948,12 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
goto error;
}
- allowed = totalram_pages * sysctl_overcommit_ratio / 100;
+ allowed = vm_commit_limit();
/*
* Reserve some 3% for root
*/
if (!cap_sys_admin)
allowed -= sysctl_admin_reserve_kbytes >> (PAGE_SHIFT - 10);
- allowed += total_swap_pages;
/*
* Don't let a single process grow so big a user can't recover