[sheepdog] [PATCH] sheep: fix bug for cluster format failed when exists gateway node

Wang Zhengyong wangzhengyong at cmss.chinamobile.com
Wed Mar 4 09:18:35 CET 2015


This commit fix Bug #1427099
https://bugs.launchpad.net/sheepdog-project/+bug/1427099
"cluster format failed when exists gateway node"

The data length  should be the the size of variable rather than poriner
In the 64-bit system the pointer size is 64bit, integer variable size is 32bit

Cc: Hitoshi Mitake <mitake.hitoshi at gmail.com>
Signed-off-by: Wang Zhengyong <wangzhengyong at cmss.chinamobile.com>
---
 sheep/ops.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sheep/ops.c b/sheep/ops.c
index 403c9b0..0e5ac64 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -1531,7 +1531,7 @@ static int local_get_vnodes(struct request *req)
 	int *nr_vnodes;
 
 	nr_vnodes = req->data;
-	req->rp.data_length = sizeof(nr_vnodes);
+	req->rp.data_length = sizeof(*nr_vnodes);
 	*nr_vnodes = sys->this_node.nr_vnodes;
 
 	return SD_RES_SUCCESS;
-- 
1.7.1






More information about the sheepdog mailing list