cpg: Fix stale state after leaving a group
Since v3.0.3, corosync never resets the state of a connection that left
a group with cpg_leave(). Commit 1e2df0ba0 ("cpg: Add more comments to
notify_lib_joinlist") turned the reset of left_list[0] into a loop over
left_list, but bounded it by joined_list_entries. No caller passes both
lists, so the loop never runs for a leave. For the same reason, it
never read past the end of left_list either.
The connection thus stays in CPD_STATE_LEAVE_STARTED with its old pid
and group name. It keeps receiving messages and configuration changes
of the group it left. Joining that group again fails with CS_ERR_EXIST,
because the duplicate check matches the connection's own stale entry.
Joining any other group gets CS_ERR_BUSY, which cpg_join() retries
without delay, so the call never returns and keeps both the client and
corosync busy.
Bound the loop by left_list_entries, restoring the behavior from before
v3.0.3.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>