diff options
author | Jody McIntyre <scjody@modernduck.com> | 2005-11-18 06:18:25 +0100 |
---|---|---|
committer | Jody McIntyre <scjody@modernduck.com> | 2005-11-18 06:18:25 +0100 |
commit | a9931a6e37c09f6b76a9fa0cbd777c335548692b (patch) | |
tree | cd6ba9d36e350dd6188f7b8f95efc59c85d34485 /ipc/shm.c | |
parent | Remove amdtp, cmp drivers. (diff) | |
parent | Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff) | |
download | linux-a9931a6e37c09f6b76a9fa0cbd777c335548692b.tar.xz linux-a9931a6e37c09f6b76a9fa0cbd777c335548692b.zip |
Merge with http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
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 b58c651d31ae..587d836d80d9 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)) |