lkml.org 
[lkml]   [2013]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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;

\
 
 \ /
  Last update: 2013-03-23 01:21    [W:0.598 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site