mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-19 13:44:03 +00:00
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>
This commit is contained in:
parent
b8fd998384
commit
39c96a1b96
2 changed files with 2 additions and 0 deletions
|
@ -515,6 +515,7 @@ static int newary(struct ipc_namespace *ns, struct ipc_params *params)
|
||||||
sma->sem_nsems = nsems;
|
sma->sem_nsems = nsems;
|
||||||
sma->sem_ctime = ktime_get_real_seconds();
|
sma->sem_ctime = ktime_get_real_seconds();
|
||||||
|
|
||||||
|
/* ipc_addid() locks sma upon success. */
|
||||||
retval = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni);
|
retval = ipc_addid(&sem_ids(ns), &sma->sem_perm, ns->sc_semmni);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
call_rcu(&sma->sem_perm.rcu, sem_rcu_free);
|
call_rcu(&sma->sem_perm.rcu, sem_rcu_free);
|
||||||
|
|
|
@ -601,6 +601,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
|
||||||
shp->shm_file = file;
|
shp->shm_file = file;
|
||||||
shp->shm_creator = current;
|
shp->shm_creator = current;
|
||||||
|
|
||||||
|
/* ipc_addid() locks shp upon success. */
|
||||||
error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
|
error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
|
||||||
if (error < 0)
|
if (error < 0)
|
||||||
goto no_id;
|
goto no_id;
|
||||||
|
|
Loading…
Add table
Reference in a new issue