[dm-devel] [PATCH] convert dm_ulog_request data to little endian

zhangdongmao dmzhang at suse.com
Wed Aug 20 03:19:02 UTC 2014


于 2014年08月20日 08:58, Brassow Jonathan 写道:
> This seems odd to me.  I don't understand why you would get a bug.  Do you have a mixed-architecture cluster?  Some x86-64 and the s390?  Otherwise, all operations should be in a format that is understood (unless there is a bug).
>
> Also, you don't really need to translate the structure just to go to userspace.  Only the process that communicates between (potentially different architectures of) machines needs to do that.  That process is cmirrord and the code that should translate for that daemon is in lvm2/daemons/cmirrord/compat.c.
>
> There could be a bug, but unless I'm not understanding right, we shouldn't need to switch endian in the kernel.
>
>   brassow
>
I think this is because cmirrord always assume the network package is 
little-endian.(see compat.c: v5_endian_from_network) .
So if cmirrord is running on S390, kernel will send package in its 
native endian(big endian), this is why data is broken.
There might have two solutions:

1. cmirrord always use native endian.
2. kernel always send little endian data.









More information about the dm-devel mailing list