Messages in this thread Patch in this message | | | Date | Fri, 22 Mar 2013 19:42:48 -0400 | From | Rik van Riel <> | Subject | [PATCH 7/7 part3] fix for sem_lock |
| |
> > + /* > > + * If sma->complex_count was set while we were spinning, > > + * we may need to look at things we did not lock here. > > + */ > > + if (unlikely(sma->complex_count)) { > > + spin_unlock(&sma->sem_perm.lock); > > I believe this should be spin_unlock(&sem->lock) instead ?
Michel, thanks for spotting this!
Andrew, could you fold this fix into my patch 7/7 before submitting things for 3.10? Thank you.
--->8--- Fix a typo in sem_lock. Of course we need to unlock the local semaphore lock before jumping to lock_all, in the rare case that somebody started a complex operation while we were spinning on the spinlock.
Can be folded into patch 7/7 before merging
Signed-off-by: Rik van Riel <riel@redhat.com> Reported-by: Michel Lespinasse <walken@google.com> --- ipc/sem.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ipc/sem.c b/ipc/sem.c index a4b93fb..450248e 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -346,7 +346,7 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops, * we may need to look at things we did not lock here. */ if (unlikely(sma->complex_count)) { - spin_unlock(&sma->sem_perm.lock); + spin_unlock(&sem->lock); goto lock_all; } locknum = sops->sem_num;
| |