Revision 2406 of corosync's coroipcc.c introduced error reporting when
dispatch_get had no events to retrieve via poll.  The problem was that
every dispatch function checked the dispatch_data value to determine if
poll_events was 0 or not.  Instead, we check for this error code in this
patch.

Note the change in 2406 exposed a possible bug where dispatch_data might
not be null and a callback would be inadvertently processed!

Also lib/quorum.c didn't have the correct code for handling the dispatch
case at all, so that has been fixed in this patch.

Regards
-steve
Index: lib/cfg.c
===================================================================
--- lib/cfg.c	(revision 2414)
+++ lib/cfg.c	(working copy)
@@ -181,8 +181,7 @@
 		if (error != CS_OK) {
 			goto error_put;
 		}
-
-		if (dispatch_data == NULL) {
+		if (error == CS_ERR_TRY_AGAIN) {
 			if (dispatch_flags == CPG_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
Index: lib/cpg.c
===================================================================
--- lib/cpg.c	(revision 2414)
+++ lib/cpg.c	(working copy)
@@ -292,8 +292,7 @@
 		if (error != CS_OK) {
 			goto error_put;
 		}
-
-		if (dispatch_data == NULL) {
+		if (error == CS_ERR_TRY_AGAIN) {
 			if (dispatch_types == CPG_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
Index: lib/votequorum.c
===================================================================
--- lib/votequorum.c	(revision 2414)
+++ lib/votequorum.c	(working copy)
@@ -719,8 +719,7 @@
 		if (error != CS_OK) {
 			goto error_put;
 		}
-
-		if (dispatch_data == NULL) {
+		if (error == CS_ERR_TRY_AGAIN) {
 			if (dispatch_types == CPG_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
Index: lib/quorum.c
===================================================================
--- lib/quorum.c	(revision 2414)
+++ lib/quorum.c	(working copy)
@@ -365,6 +365,13 @@
 		if (error != CS_OK) {
 			goto error_put;
 		}
+		if (error == CS_ERR_TRY_AGAIN) {
+			if (dispatch_types == CPG_DISPATCH_ALL) {
+				break; /* exit do while cont is 1 loop */
+			} else {
+				continue; /* next poll */
+			}
+		}
 
 		/*
 		 * Make copy of callbacks, message data, unlock instance, and call callback
Index: lib/confdb.c
===================================================================
--- lib/confdb.c	(revision 2414)
+++ lib/confdb.c	(working copy)
@@ -316,7 +316,7 @@
 		if (error != CS_OK) {
 			goto error_put;
 		}
-		if (dispatch_data == NULL) {
+		if (error == CS_ERR_TRY_AGAIN) {
 			if (dispatch_types == CONFDB_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
Index: lib/evs.c
===================================================================
--- lib/evs.c	(revision 2414)
+++ lib/evs.c	(working copy)
@@ -258,8 +258,7 @@
 		if (error != CS_OK) {
 			goto error_put;
 		}
-
-		if (dispatch_data == NULL) {
+		if (error == CS_ERR_TRY_AGAIN) {
 			if (dispatch_types == CPG_DISPATCH_ALL) {
 				break; /* exit do while cont is 1 loop */
 			} else {
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to