[PATCH 5/5] CPG: fix membership_get()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



1) remove BUSY loop from membership get
   Note only cpg_join and cpg_leave ever set the
   BUSY error code.
2) set the size correctly
3) copy the name in correctly

Signed-off-by: Angus Salkeld <asalkeld@xxxxxxxxxx>
---
 lib/cpg.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/lib/cpg.c b/lib/cpg.c
index 7e325e9..0db64f6 100644
--- a/lib/cpg.c
+++ b/lib/cpg.c
@@ -52,6 +52,7 @@
 
 #include <qb/qbdefs.h>
 #include <qb/qbipcc.h>
+#include <qb/qblog.h>
 
 #include <corosync/hdb.h>
 #include <corosync/list.h>
@@ -606,20 +607,18 @@ cs_error_t cpg_membership_get (
 	req_lib_cpg_membership_get.header.size = sizeof (struct req_lib_cpg_membership_get);
 	req_lib_cpg_membership_get.header.id = MESSAGE_REQ_CPG_MEMBERSHIP;
 
-	memcpy (&req_lib_cpg_membership_get.group_name, group_name,
-		sizeof (struct cpg_name));
+	marshall_to_mar_cpg_name_t (&req_lib_cpg_membership_get.group_name,
+		group_name);
 
 	iov.iov_base = (void *)&req_lib_cpg_membership_get;
-	iov.iov_len = sizeof (struct qb_ipc_request_header);
+	iov.iov_len = sizeof (struct req_lib_cpg_membership_get);
 
-	do {
-		error = coroipcc_msg_send_reply_receive (cpg_inst->c, &iov, 1,
-				&res_lib_cpg_membership_get, sizeof (res_lib_cpg_membership_get));
+	error = coroipcc_msg_send_reply_receive (cpg_inst->c, &iov, 1,
+			&res_lib_cpg_membership_get, sizeof (res_lib_cpg_membership_get));
 
-		if (error != CS_OK) {
-			goto error_exit;
-		}
-	} while (res_lib_cpg_membership_get.header.error == CS_ERR_BUSY);
+	if (error != CS_OK) {
+		goto error_exit;
+	}
 
 	error = res_lib_cpg_membership_get.header.error;
 
-- 
1.7.7.6

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux