diff options
author | Davidlohr Bueso <dave@stgolabs.net> | 2017-11-17 18:31:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-17 19:10:04 -0500 |
commit | 39c96a1b96a5991b1c9e79b85a8d74ef93b36026 (patch) | |
tree | 5bd92209fad8d1a35f9a7720829204862ad29723 /ipc | |
parent | b8fd99838435f9b420c3e848192bd43abc648b7f (diff) |
sysvipc: duplicate lock comments wrt ipc_addid()
The comment in msgqueues when using ipc_addid() is quite useful imo.
Duplicate it for shm and semaphores.
Link: http://lkml.kernel.org/r/20170831172049.14576-3-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/sem.c | 1 | ||||
-rw-r--r-- | ipc/shm.c | 1 |
2 files changed, 2 insertions, 0 deletions
@@ -515,6 +515,7 @@ static int newary(struct ipc_namespace *ns, struct ipc_params *params) | |||
515 | sma->sem_nsems = nsems; | 515 | sma->sem_nsems = nsems; |
516 | sma->sem_ctime = ktime_get_real_seconds(); | 516 | sma->sem_ctime = ktime_get_real_seconds(); |
517 | 517 | ||
518 | /* ipc_addid() locks sma upon success. */ | ||
518 | retval = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni); | 519 | retval = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni); |
519 | if (retval < 0) { | 520 | if (retval < 0) { |
520 | call_rcu(&sma->sem_perm.rcu, sem_rcu_free); | 521 | call_rcu(&sma->sem_perm.rcu, sem_rcu_free); |
@@ -601,6 +601,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) | |||
601 | shp->shm_file = file; | 601 | shp->shm_file = file; |
602 | shp->shm_creator = current; | 602 | shp->shm_creator = current; |
603 | 603 | ||
604 | /* ipc_addid() locks shp upon success. */ | ||
604 | error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); | 605 | error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); |
605 | if (error < 0) | 606 | if (error < 0) |
606 | goto no_id; | 607 | goto no_id; |