diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-09-09 18:02:02 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-09-09 18:02:02 -0400 |
commit | bf992fa2bc1ad1bb2aeb0bdfadb43f236b9297fd (patch) | |
tree | d67f525c76b66956ba7ca0d40bc0fcda0e414700 /ipc | |
parent | 9d7302299ee96ca954fe4ab8ca640333b6e19ad0 (diff) | |
parent | 7135a71b19be1faf48b7148d77844d03bc0717d6 (diff) |
Merge branch 'master' into for-linus
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/shm.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -174,7 +174,7 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp) | |||
174 | shm_unlock(shp); | 174 | shm_unlock(shp); |
175 | if (!is_file_hugepages(shp->shm_file)) | 175 | if (!is_file_hugepages(shp->shm_file)) |
176 | shmem_lock(shp->shm_file, 0, shp->mlock_user); | 176 | shmem_lock(shp->shm_file, 0, shp->mlock_user); |
177 | else | 177 | else if (shp->mlock_user) |
178 | user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size, | 178 | user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size, |
179 | shp->mlock_user); | 179 | shp->mlock_user); |
180 | fput (shp->shm_file); | 180 | fput (shp->shm_file); |
@@ -369,8 +369,8 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) | |||
369 | /* hugetlb_file_setup applies strict accounting */ | 369 | /* hugetlb_file_setup applies strict accounting */ |
370 | if (shmflg & SHM_NORESERVE) | 370 | if (shmflg & SHM_NORESERVE) |
371 | acctflag = VM_NORESERVE; | 371 | acctflag = VM_NORESERVE; |
372 | file = hugetlb_file_setup(name, size, acctflag); | 372 | file = hugetlb_file_setup(name, size, acctflag, |
373 | shp->mlock_user = current_user(); | 373 | &shp->mlock_user); |
374 | } else { | 374 | } else { |
375 | /* | 375 | /* |
376 | * Do not allow no accounting for OVERCOMMIT_NEVER, even | 376 | * Do not allow no accounting for OVERCOMMIT_NEVER, even |
@@ -410,6 +410,8 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) | |||
410 | return error; | 410 | return error; |
411 | 411 | ||
412 | no_id: | 412 | no_id: |
413 | if (shp->mlock_user) /* shmflg & SHM_HUGETLB case */ | ||
414 | user_shm_unlock(size, shp->mlock_user); | ||
413 | fput(file); | 415 | fput(file); |
414 | no_file: | 416 | no_file: |
415 | security_shm_free(shp); | 417 | security_shm_free(shp); |