Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1724438
| From | Davidlohr Bueso <dave@stgolabs.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/4] sysvipc: duplicate lock comments wrt ipc_addid() |
| Date | 2017-08-31 19:30 +0200 |
| Message-ID | <ukBrY-4T-3@gated-at.bofh.it> (permalink) |
| References | <ukBrY-4T-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The comment in msgqueues when using ipc_addid() is quite
useful imo. Duplicate it for shm and semaphores.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
ipc/sem.c | 1 +
ipc/shm.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/ipc/sem.c b/ipc/sem.c
index 013c7981f3c7..29c6ab6badc2 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -514,6 +514,7 @@ static int newary(struct ipc_namespace *ns, struct ipc_params *params)
sma->sem_nsems = nsems;
sma->sem_ctime = get_seconds();
+ /* ipc_addid() locks sma upon success. */
retval = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni);
if (retval < 0) {
call_rcu(&sma->sem_perm.rcu, sem_rcu_free);
diff --git a/ipc/shm.c b/ipc/shm.c
index 8fc97beb5234..ea64ed8782b3 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -600,6 +600,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
shp->shm_file = file;
shp->shm_creator = current;
+ /* ipc_addid() locks shp upon success. */
error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
if (error < 0)
goto no_id;
--
2.12.0
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 2/4] sysvipc: duplicate lock comments wrt ipc_addid() Davidlohr Bueso <dave@stgolabs.net> - 2017-08-31 19:30 +0200
csiph-web