aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2009-03-23 19:52:46 -0400
committerJames Morris <jmorris@namei.org>2009-03-23 19:52:46 -0400
commit703a3cd72817e99201cef84a8a7aecc60b2b3581 (patch)
tree3e943755178ff410694722bb031f523136fbc432 /ipc
parentdf7f54c012b92ec93d56b68547351dcdf8a163d3 (diff)
parent8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff)
Merge branch 'master' into next
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c8
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)
341 struct file * file; 341 struct file * file;
342 char name[13]; 342 char name[13];
343 int id; 343 int id;
344 int acctflag = 0;
344 345
345 if (size < SHMMIN || size > ns->shm_ctlmax) 346 if (size < SHMMIN || size > ns->shm_ctlmax)
346 return -EINVAL; 347 return -EINVAL;
@@ -365,11 +366,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
365 366
366 sprintf (name, "SYSV%08x", key); 367 sprintf (name, "SYSV%08x", key);
367 if (shmflg & SHM_HUGETLB) { 368 if (shmflg & SHM_HUGETLB) {
368 /* hugetlb_file_setup takes care of mlock user accounting */ 369 /* hugetlb_file_setup applies strict accounting */
369 file = hugetlb_file_setup(name, size); 370 if (shmflg & SHM_NORESERVE)
371 acctflag = VM_NORESERVE;
372 file = hugetlb_file_setup(name, size, acctflag);
370 shp->mlock_user = current_user(); 373 shp->mlock_user = current_user();
371 } else { 374 } else {
372 int acctflag = 0;
373 /* 375 /*
374 * Do not allow no accounting for OVERCOMMIT_NEVER, even 376 * Do not allow no accounting for OVERCOMMIT_NEVER, even
375 * if it's asked for. 377 * if it's asked for.