Commit a2780c61 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

lock: futex() with timeout isn't restarted after signals (v2)

It returns EINTR, so we need to handle it.

$ bash test/zdtm.sh --restore-sibling ns/static/env00
...
futex(0x7fc20ec92010, FUTEX_WAIT, 1, {120, 0}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8f36b7af
......@@ -50,7 +50,12 @@ static inline void futex_set(futex_t *f, u32 v)
pr_warn("blocked for more than 120 seconds\n"); \
continue; \
} \
BUG_ON(ret < 0 && ret != -EWOULDBLOCK); \
if (ret == -EINTR || ret == -EWOULDBLOCK) \
continue; \
if (ret < 0) { \
pr_err("futex() returned an unexpected error: %d\n", ret); \
BUG(); \
} \
} \
} while (0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment