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 <[email protected]>
---
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