lkml.org 
[lkml]   [2013]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ipc/sem.c: scan complex wait-for-zero after undefined updates
Date
After an update of a semaphore array that does not use struct sembuf,
complex wait-for-zero operations were not checked if they are able to
proceed.

Andrew: Could you add it to -mm?
I've introduced the bug with
ipc-sem-separate-wait-for-zero-and-alter-tasks-into-seperate-queues.patch

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
---
ipc/sem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ipc/sem.c b/ipc/sem.c
index f9d1c06..ad9daca 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -785,8 +785,10 @@ static int do_smart_wakeup_zero(struct sem_array *sma, struct sembuf *sops,
* Assume all were changed.
*/
for (i = 0; i < sma->sem_nsems; i++) {
- if (sma->sem_base[i].semval == 0)
+ if (sma->sem_base[i].semval == 0) {
+ got_zero = 1;
semop_completed |= wake_const_ops(sma, i, pt);
+ }
}
}
/*
--
1.8.1.4


\
 
 \ /
  Last update: 2013-06-15 17:01    [W:0.019 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site