multipath-tools: release lock on handler failure
authorMichael Wang <yun.wang@profitbricks.com>
Wed, 12 Oct 2016 08:54:05 +0000 (10:54 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 17 Oct 2016 08:31:23 +0000 (10:31 +0200)
commitb5f307d25c41c9020dd4f3ab704d0c7954314c15
tree926ffca9ff143950a33d59020fd012ae6a2e6aa2
parent4c4b5def5d807f0de0c041632f50b66b55984a73
multipath-tools: release lock on handler failure

Inside parse_cmd() the pthread_cleanup_pop() rely on '!r' as the
indicator of locked or not, while this will be overwritten if the
handler return failed, and the unlock will be missing.

This will lead into the situation that all the following operation
will trying to hold a lock which will never be released.

This patch using a separate flag to record the status of locking to
make sure the unlock and lock are in pairs.

Signed-off-by: Michael Wang <yun.wang@profitbricks.com>
multipathd/cli.c