HomeClusterLabs Projects

Fix: election/fencing: Fix the casts that would result in incorrect values for…

Description

Fix: election/fencing: Fix the casts that would result in incorrect values for big-endian systems

In an s390x cluster, after the DC shuts down, the other node will go
into election loops. Because no one can win when comparing with the
incorrect huge age values of the other nodes.

For example with:
crm_element_value_int(vote, F_CRM_ELECTION_AGE_US, (int *)&(your_age.tv_usec));

In the "vote" XML, we have:
F_CRM_ELECTION_AGE_US: 30070 (0x7576)

Since timeval.tv_usec is a long int, in a 64-bit big-endian system, we'll
get:
your_age.tv_usec: 129149666590720 (0x757600000000)

Details

Provenance
gao-yanAuthored on Nov 4 2013, 4:40 AM
Parents
rP63b54a7cf5e8: Merge pull request #382 from SynetoNet/master
Branches
Unknown
Tags
Unknown

Event Timeline