Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372855
b: refs/heads/master
c: 4091fd9
h: refs/heads/master
i:
  372853: 9f1b7ba
  372851: cec73d4
  372847: 6609edc
v: v3
  • Loading branch information
Linus Torvalds committed May 5, 2013
1 parent 396465f commit d25c835
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73b29505c36eeb4751eccad41f6aad78562521f8
refs/heads/master: 4091fd942e96af5a0b1dfa6aac5f44153ebf7cdb
5 changes: 3 additions & 2 deletions trunk/ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ static inline struct sem_array *sem_obtain_object_check(struct ipc_namespace *ns

static inline void sem_lock_and_putref(struct sem_array *sma)
{
rcu_read_lock();
sem_lock(sma, NULL, -1);
ipc_rcu_putref(sma);
}
Expand Down Expand Up @@ -1117,6 +1116,7 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
return -ENOMEM;
}

rcu_read_lock();
sem_lock_and_putref(sma);
if (sma->sem_perm.deleted) {
sem_unlock(sma, -1);
Expand Down Expand Up @@ -1166,6 +1166,7 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
goto out_free;
}
}
rcu_read_lock();
sem_lock_and_putref(sma);
if (sma->sem_perm.deleted) {
sem_unlock(sma, -1);
Expand Down Expand Up @@ -1451,7 +1452,7 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)
}

/* step 3: Acquire the lock on semaphore array */
/* This also does the rcu_read_lock() */
rcu_read_lock();
sem_lock_and_putref(sma);
if (sma->sem_perm.deleted) {
sem_unlock(sma, -1);
Expand Down

0 comments on commit d25c835

Please sign in to comment.