diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-09 01:20:26 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-09 01:20:26 -0500 |
commit | c7c6e9494cc9a4a5b1a2ca870ed4531ad2b98a83 (patch) | |
tree | 1185ddc2c4cea1c4da09d6b83893f91aefe7cd3d /ipc/shm.c | |
parent | 8cedcfd43a0b00741fff43d6a4c1a8b7748db3b0 (diff) | |
parent | 8e8b77dd4846b73f2e0756cf59123ee709246d11 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ipc/shm.c b/ipc/shm.c index b58c651d31a..587d836d80d 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -212,8 +212,16 @@ static int newseg (key_t key, int shmflg, size_t size) file = hugetlb_zero_setup(size); shp->mlock_user = current->user; } else { + int acctflag = VM_ACCOUNT; + /* + * Do not allow no accounting for OVERCOMMIT_NEVER, even + * if it's asked for. + */ + if ((shmflg & SHM_NORESERVE) && + sysctl_overcommit_memory != OVERCOMMIT_NEVER) + acctflag = 0; sprintf (name, "SYSV%08x", key); - file = shmem_file_setup(name, size, VM_ACCOUNT); + file = shmem_file_setup(name, size, acctflag); } error = PTR_ERR(file); if (IS_ERR(file)) |