diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-08-25 10:47:48 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-25 10:47:48 +0200 |
commit | 89236ce246166dc6fceef1164bd19cfc13b477a0 (patch) | |
tree | 3431f04a1d35c7e0a442f2cbfbba35ab324c2631 /ipc | |
parent | 8453411846008456d94e6a15d238094a9751ffe0 (diff) | |
parent | 7c0a57d5c47bcfc492b3139e77400f888a935c44 (diff) | |
download | lwn-89236ce246166dc6fceef1164bd19cfc13b477a0.tar.gz lwn-89236ce246166dc6fceef1164bd19cfc13b477a0.zip |
Merge branch 'linus' into rt/base
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 15dd238e5338..1bc4701ef4f0 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -174,7 +174,7 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp) shm_unlock(shp); if (!is_file_hugepages(shp->shm_file)) shmem_lock(shp->shm_file, 0, shp->mlock_user); - else + else if (shp->mlock_user) user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size, shp->mlock_user); fput (shp->shm_file); @@ -369,8 +369,8 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) /* 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(); + file = hugetlb_file_setup(name, size, acctflag, + &shp->mlock_user); } else { /* * Do not allow no accounting for OVERCOMMIT_NEVER, even @@ -410,6 +410,8 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) return error; no_id: + if (shp->mlock_user) /* shmflg & SHM_HUGETLB case */ + user_shm_unlock(size, shp->mlock_user); fput(file); no_file: security_shm_free(shp); |