ctdb-ipalloc: Fix buggy short-circuit when no IPs are available
authorMartin Schwenke <martin@meltin.net>
Wed, 29 Jun 2016 06:36:28 +0000 (16:36 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 4 Jul 2016 13:42:25 +0000 (15:42 +0200)
commit86f7c4d7f360457cdd41e456aafbf90291f5bfbb
treeb55673f8f025f0beb26026a543d547d215e6fe8e
parentc5d85a071b33ac8a80ae8f6ddaf26f9fa7bc67a6
ctdb-ipalloc: Fix buggy short-circuit when no IPs are available

At the moment IP is short-circuited when there are no available IP
addresses.  However, if some IP addresses are already allocated then
"no available IP addresses" means that all the addresses should
(probably) be released.  The current short-circuit means that no
already hosted IP addresses will be released.

The short-circuit exists to avoid lots of messages saying that all IP
addresses can not be assigned at startup time.  So, add a check to
ipalloc_can_host_ips() so that it succeeds if IP addresses are already
allocated to nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ipalloc.c