From 08745892b4edd34296bfa5f2f4967329515346fb Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Tue, 10 Jul 2012 09:33:02 -0400 Subject: calls to dict_allocate_and_serialize() are not 64-bit clean All calls to dict_allocate_and_serialize() pass the address of a 32-bit type, but must cast it to the 64-bit pointer type (size_t *). This happens to work on LE machines, but even if it's apparently benign, it's still a bug. On BE machines it is not benign. GF_PROTOCOL_DICT_SERIALIZE() hacks around it by creating a size_t temp var, but that's, well, a hack, IMO when you consider that all the callers are actually passing &; the param should just be a u_int * and eliminate the buggy casts and the temp var in the macro. Nobody apparently uses the Fedora/EPEL PPC RPMs, but they might. People are trying to build gluster.org bits on SPARC and tripping over this. Change-Id: I92ea139f9e3e91ddbbb32a51b96fa582a9515626 Signed-off-by: Kaleb S. KEITHLEY BUG: 838928 Reviewed-on: http://review.gluster.com/3642 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-syncop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index 7cdc1c3c28b..2b2e9d2e69d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -295,8 +295,8 @@ gd_syncop_mgmt_stage_op (struct rpc_clnt *rpc, uuid_t my_uuid, uuid_t recv_uuid, args.op_ret = -1; args.op_errno = ENOTCONN; - ret = dict_allocate_and_serialize (dict_out, &req.buf.buf_val, - (size_t *)&req.buf.buf_len); + ret = dict_allocate_and_serialize (dict_out, + &req.buf.buf_val, &req.buf.buf_len); if (ret) goto out; @@ -395,8 +395,8 @@ gd_syncop_mgmt_commit_op (struct rpc_clnt *rpc, uuid_t my_uuid, uuid_t recv_uuid args.op_ret = -1; args.op_errno = ENOTCONN; - ret = dict_allocate_and_serialize (dict_out, &req.buf.buf_val, - (size_t *)&req.buf.buf_len); + ret = dict_allocate_and_serialize (dict_out, + &req.buf.buf_val, &req.buf.buf_len); if (ret) goto out; -- cgit