• Manfred Spraul's avatar
    [PATCH] fix missing wakeup in ipc/sem · 956cdd1b
    Manfred Spraul authored
    My patch that removed the spin_lock calls from the tail of sys_semtimedop
    introduced a bug:
    
    Before my patch was merged, every operation that altered an array called
    update_queue.  That call woke up threads that were waiting until a
    semaphore value becomes 0.  I've accidentially removed that call.
    
    The attached patch fixes that by modifying update_queue: the function now
    loops internally and wakes up all threads.  The patch also removes
    update_queue calls from the error path of sys_semtimedop: failed operations
    do not modify the array, no need to rescan the list of waiting threads.
    Signed-Off-By: default avatarManfred Spraul <manfred@colorfullife.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    956cdd1b
sem.c 33.6 KB