diff options
author | James Morris <jmorris@namei.org> | 2009-03-24 10:52:46 +1100 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-03-24 10:52:46 +1100 |
commit | 703a3cd72817e99201cef84a8a7aecc60b2b3581 (patch) | |
tree | 3e943755178ff410694722bb031f523136fbc432 /ipc/shm.c | |
parent | df7f54c012b92ec93d56b68547351dcdf8a163d3 (diff) | |
parent | 8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff) | |
download | op-kernel-dev-703a3cd72817e99201cef84a8a7aecc60b2b3581.zip op-kernel-dev-703a3cd72817e99201cef84a8a7aecc60b2b3581.tar.gz |
Merge branch 'master' into next
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -341,6 +341,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) struct file * file; char name[13]; int id; + int acctflag = 0; if (size < SHMMIN || size > ns->shm_ctlmax) return -EINVAL; @@ -365,11 +366,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) sprintf (name, "SYSV%08x", key); if (shmflg & SHM_HUGETLB) { - /* hugetlb_file_setup takes care of mlock user accounting */ - file = hugetlb_file_setup(name, size); + /* hugetlb_file_setup applies strict accounting */ + if (shmflg & SHM_NORESERVE) + acctflag = VM_NORESERVE; + file = hugetlb_file_setup(name, size, acctflag); shp->mlock_user = current_user(); } else { - int acctflag = 0; /* * Do not allow no accounting for OVERCOMMIT_NEVER, even * if it's asked for. |