------- Comment From [email protected] 2019-01-10 08:20 EDT-------
I investigated the encode() / decode() of the magic number bit more:

Ceph seems use internally little endian data format. So the decoding of
the magic number
(https://github.com/ceph/ceph/blob/v12.1.2/src/crush/CrushWrapper.cc#L2097-L2105)
converts from little to big endian on s390.

For __u32 this is done encoding.h:
https://github.com/ceph/ceph/blob/v12.1.2/src/include/encoding.h#L109

The conversion is done in the cast operator
(https://github.com/ceph/ceph/blob/v12.1.2/src/include/encoding.h#L104)
of the "struct ceph_le" template class:
https://github.com/ceph/ceph/blob/v12.1.2/src/include/byteorder.h#L70-L72

For the byte swap operation form little to big endian the mswab()
function is used:
https://github.com/ceph/ceph/blob/v12.1.2/src/include/byteorder.h#L54-L58

The magic number seems to be properly encoded: 
https://github.com/ceph/ceph/blob/v12.1.2/src/crush/CrushWrapper.cc#L1922-L1927
And decoded: 
https://github.com/ceph/ceph/blob/v12.1.2/src/crush/CrushWrapper.cc#L2097-L2105

So at least no obvious / trivial problem here.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1713032

Title:
  [luminous] ceph-mon crashes when it is elected leader (s390x)

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1713032/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to