• Thomas Gleixner's avatar
    [PATCH] Use the correct restart option for futex_lock_pi · c5780e97
    Thomas Gleixner authored
    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: default avatarThomas Gleixner <tglx@linutronix.de>
    Acked-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    c5780e97
futex.c 43.5 KB