multipathd: handler fixes
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 31 May 2016 23:16:44 +0000 (18:16 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 3 Jun 2016 06:51:09 +0000 (08:51 +0200)
commit2d0aca8267fead1966886c89333662efee962777
tree8e874fd0cca3c60102089960f9ae68ddaac72ee5
parent7719f41beb7171f13c65b4d123d50ab6372e0468
multipathd: handler fixes

We now have unlocked handlers, but these can't be used to call functions
that will access the pathvec, mpvec, or conf, since these are what the
vecs lock protects. cli_list_config and cli_list_blacklist both need to
access conf, so they can't be unlocked handlers.

Also, if parse_cmd fails to lock the vecs->lock when it calls
pthread_mutex_timedlock, we can't call unlock() on it, because unlocking
a mutex you haven't locked causes undefined behviour. So we need to
only execute the handler if didn't timeout trying to acquire the lock.

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