diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-05-19 17:04:59 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-05-20 04:34:32 -0400 |
commit | 2070887fdeacd9c13f3e805e3f0086c9f22a4d93 (patch) | |
tree | f1695bd701f7a2558e11052bfe6ff42d6dc561df /security/keys/user_defined.c | |
parent | 1c840c14906d4ddf66c1f4f5daea059aad951c82 (diff) |
futex: fix restart in wait_requeue_pi
If the waiter has been requeued to the outer PI futex and is
interrupted by a signal and the thread handles the signal then
ERESTART_RESTARTBLOCK is changed to EINTR and the restart block is
discarded. That way we return an unexcpected EINTR to user space
instead of ending up in futex_lock_pi_restart.
But we do not need to restart the syscall because we know that the
condition has changed since we have been requeued. If we would simply
restart the syscall then we would drop out via the comparison of the
user space value with EWOULDBLOCK.
The user space side needs to handle EWOULDBLOCK anyway as the
enqueueing on the inner futex can race with a requeue/wake. So we can
simply return EWOULDBLOCK to user space which also signals that we did
not take the outer futex and let user space handle it in the same way
it has to handle the requeue/wake race.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'security/keys/user_defined.c')
0 files changed, 0 insertions, 0 deletions