summaryrefslogtreecommitdiff
path: root/daemons/cmirrord
diff options
context:
space:
mode:
authorLiuhua Wang <lwang@suse.com>2014-09-13 02:08:28 -0500
committerJonathan Brassow <jbrassow@redhat.com>2014-09-15 16:08:35 -0500
commit829e5a40373a2ef1721dc9210350c86c4b9d70f7 (patch)
tree3e8670dfd3141eb619b362e931cdf9ab4177b496 /daemons/cmirrord
parente9216eedfe8189947c506041d8fc9e879fac6d58 (diff)
downloadlvm2-829e5a40373a2ef1721dc9210350c86c4b9d70f7.tar.gz
cmirror: fix endian issues on s390
Cmirrord has endian bugs, which cause failure to lvcreate a mirrored lv on s390. - data_size is uint32, should not use xlate64 to convert, which will cause data_size 0 after xlate. - request_type and data_size still used by local(v5_data_switch), should convert later. If request_type xlate too early, it will cause request_type judge error; if data_size xlate too early, it will cause coredump in case DM_ULOG_CLEAR_REGION. - when receiving package in clog_request_from_network. vp[0] will always be little endian. We could use xlate64(vp[0]) == vp[0] to decide if the local node is little endian or not. Signed-off-by: Lidong Zhong<lzhong@suse.com> & Liuhua Wang <lwang@suse.com> Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Diffstat (limited to 'daemons/cmirrord')
-rw-r--r--daemons/cmirrord/compat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/daemons/cmirrord/compat.c b/daemons/cmirrord/compat.c
index 3f7a9b51d..4955f50b2 100644
--- a/daemons/cmirrord/compat.c
+++ b/daemons/cmirrord/compat.c
@@ -126,13 +126,14 @@ static int v5_endian_to_network(struct clog_request *rq)
u_rq->error = xlate32(u_rq->error);
u_rq->seq = xlate32(u_rq->seq);
- u_rq->request_type = xlate32(u_rq->request_type);
- u_rq->data_size = xlate64(u_rq->data_size);
rq->originator = xlate32(rq->originator);
v5_data_endian_switch(rq, 1);
+ u_rq->request_type = xlate32(u_rq->request_type);
+ u_rq->data_size = xlate32(u_rq->data_size);
+
return size;
}
@@ -167,7 +168,7 @@ static int v5_endian_from_network(struct clog_request *rq)
u_rq->error = xlate32(u_rq->error);
u_rq->seq = xlate32(u_rq->seq);
u_rq->request_type = xlate32(u_rq->request_type);
- u_rq->data_size = xlate64(u_rq->data_size);
+ u_rq->data_size = xlate32(u_rq->data_size);
rq->originator = xlate32(rq->originator);
@@ -187,7 +188,7 @@ int clog_request_from_network(void *data, size_t data_len)
switch (version) {
case 5: /* Upstream */
- if (version == unconverted_version)
+ if (version == vp[0])
return 0;
break;
case 4: /* RHEL 5.[45] */