]> git.kernelconcepts.de Git - karo-tx-linux.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)
commitc5780e976e19faff345fcef4a01db87108b51a44
tree1e75fc4cd3765beb575fb3196a477d97ed1905a4
parent3a459756810912d2c2bf188cef566af255936b4d
[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