aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
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.