]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] Use the correct restart option for futex_lock_pi
authorThomas Gleixner <tglx@linutronix.de>
Fri, 8 Sep 2006 16:47:15 +0000 (09:47 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 8 Sep 2006 17:22:50 +0000 (10:22 -0700)
commita29eef8787018a9b6b94a59899d05d513d63a20c
tree1e75fc4cd3765beb575fb3196a477d97ed1905a4
parentfa6a502e0606b0d7754d9675cc938b68828c8ffd
[PATCH] Use the correct restart option for futex_lock_pi

The current implementation of futex_lock_pi returns -ERESTART_RESTARTBLOCK
in case that the lock operation has been interrupted by a signal.  This
results in a return of -EINTR to userspace in case there is an handler for
the signal.  This is wrong, because userspace expects that the lock
function does not return in any case of signal delivery.

This was not caught by my insufficient test case, but triggered a nasty
userspace problem in an high load application scenario.  Unfortunately also
glibc does not check for this invalid return value.

Using -ERSTARTNOINTR makes sure, that the interrupted syscall is restarted.
 The restart block related code can be safely removed, as the possible
timeout argument is an absolute time value.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/futex.c