multipathd: use nanosleep for strict timing
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 14 Mar 2018 17:46:39 +0000 (12:46 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 27 Mar 2018 20:20:05 +0000 (22:20 +0200)
commitc347a0e20780a739a75bf2afc2cbfa04bbf67e87
tree406f133ce87616232abc9303c2bcee0e754438e3
parentf2c8d994aa7ba8e0e10a609851d6e4cc9ef99fcd
multipathd: use nanosleep for strict timing

In order to safely use SIGALRM in a multi-threaded program, only one
thread can schedule and wait on SIGALRM at a time. All other threads
must have SIGALRM blocked, and be unable to schedule an alarm. The
strict_timing code in checkerloop was unblocking SIGALRM, and calling
setitimer(), without any locking.  Instead, it should use nanosleep()
to sleep for the correct length of time, since that doesn't depend or
interfere with signals.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
multipathd/main.c