diff options
author | James Morris <jmorris@namei.org> | 2009-03-24 00:52:46 +0100 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-03-24 00:52:46 +0100 |
commit | 703a3cd72817e99201cef84a8a7aecc60b2b3581 (patch) | |
tree | 3e943755178ff410694722bb031f523136fbc432 /ipc | |
parent | SELinux: inode_doinit_with_dentry drop no dentry printk (diff) | |
parent | Linux 2.6.29 (diff) | |
download | linux-703a3cd72817e99201cef84a8a7aecc60b2b3581.tar.xz linux-703a3cd72817e99201cef84a8a7aecc60b2b3581.zip |
Merge branch 'master' into next
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/shm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ipc/shm.c b/ipc/shm.c index 2bd4809508a4..f239d87e0d37 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -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. |