If a dispatch handler is undefined, the C compiler automatically defines
it to NULL. This is intended behavior. The dispatch functions check
whether the value is NULL (meaning no action should be taken from the
library point of view) and call "continue". This doesn't trigger the
dispatch_put operation locking up the cpg dispatch operations. Instead
"break" should be called to exit the switch and allow normal processing
of the dispatch functions.
Regards
-steve
Index: lib/cfg.c
===================================================================
--- lib/cfg.c (revision 2753)
+++ lib/cfg.c (working copy)
@@ -203,7 +203,7 @@
switch (dispatch_data->id) {
case MESSAGE_RES_CFG_TESTSHUTDOWN:
if (callbacks.corosync_cfg_shutdown_callback == NULL) {
- continue;
+ break;
}
res_lib_cfg_testshutdown = (struct res_lib_cfg_testshutdown *)dispatch_data;
Index: lib/cpg.c
===================================================================
--- lib/cpg.c (revision 2753)
+++ lib/cpg.c (working copy)
@@ -339,7 +339,7 @@
switch (dispatch_data->id) {
case MESSAGE_RES_CPG_DELIVER_CALLBACK:
if (callbacks.cpg_deliver_fn == NULL) {
- continue;
+ break;
}
res_cpg_deliver_callback = (struct res_lib_cpg_deliver_callback *)dispatch_data;
@@ -358,7 +358,7 @@
case MESSAGE_RES_CPG_CONFCHG_CALLBACK:
if (callbacks.cpg_confchg_fn == NULL) {
- continue;
+ break;
}
res_cpg_confchg_callback = (struct res_lib_cpg_confchg_callback *)dispatch_data;
Index: lib/votequorum.c
===================================================================
--- lib/votequorum.c (revision 2753)
+++ lib/votequorum.c (working copy)
@@ -742,7 +742,7 @@
case MESSAGE_RES_VOTEQUORUM_NOTIFICATION:
if (callbacks.votequorum_notify_fn == NULL) {
- continue;
+ break;
}
res_lib_votequorum_notification = (struct res_lib_votequorum_notification *)dispatch_data;
@@ -756,7 +756,7 @@
case MESSAGE_RES_VOTEQUORUM_EXPECTEDVOTES_NOTIFICATION:
if (callbacks.votequorum_expectedvotes_notify_fn == NULL) {
- continue;
+ break;
}
res_lib_votequorum_expectedvotes_notification = (struct res_lib_votequorum_expectedvotes_notification *)dispatch_data;
Index: lib/quorum.c
===================================================================
--- lib/quorum.c (revision 2753)
+++ lib/quorum.c (working copy)
@@ -387,7 +387,7 @@
case MESSAGE_RES_QUORUM_NOTIFICATION:
if (callbacks.quorum_notify_fn == NULL) {
- continue;
+ break;
}
res_lib_quorum_notification = (struct res_lib_quorum_notification *)dispatch_data;
Index: lib/confdb.c
===================================================================
--- lib/confdb.c (revision 2753)
+++ lib/confdb.c (working copy)
@@ -341,7 +341,7 @@
switch (dispatch_data->id) {
case MESSAGE_RES_CONFDB_KEY_CHANGE_CALLBACK:
if (callbacks.confdb_key_change_notify_fn == NULL) {
- continue;
+ break;
}
res_key_changed_pt = (struct res_lib_confdb_key_change_callback *)dispatch_data;
@@ -360,7 +360,7 @@
case MESSAGE_RES_CONFDB_OBJECT_CREATE_CALLBACK:
if (callbacks.confdb_object_create_change_notify_fn == NULL) {
- continue;
+ break;
}
res_object_created_pt = (struct res_lib_confdb_object_create_callback *)dispatch_data;
@@ -374,7 +374,7 @@
case MESSAGE_RES_CONFDB_OBJECT_DESTROY_CALLBACK:
if (callbacks.confdb_object_delete_change_notify_fn == NULL) {
- continue;
+ break;
}
res_object_destroyed_pt = (struct res_lib_confdb_object_destroy_callback *)dispatch_data;
@@ -387,7 +387,7 @@
case MESSAGE_RES_CONFDB_RELOAD_CALLBACK:
if (callbacks.confdb_reload_notify_fn == NULL) {
- continue;
+ break;
}
res_reload_pt = (struct res_lib_confdb_reload_callback *)dispatch_data;
Index: lib/evs.c
===================================================================
--- lib/evs.c (revision 2753)
+++ lib/evs.c (working copy)
@@ -279,7 +279,7 @@
switch (dispatch_data->id) {
case MESSAGE_RES_EVS_DELIVER_CALLBACK:
if (callbacks.evs_deliver_fn == NULL) {
- continue;
+ break;
}
res_evs_deliver_callback = (struct res_evs_deliver_callback *)dispatch_data;
@@ -292,7 +292,7 @@
case MESSAGE_RES_EVS_CONFCHG_CALLBACK:
if (callbacks.evs_confchg_fn == NULL) {
- continue;
+ break;
}
res_evs_confchg_callback = (struct res_evs_confchg_callback *)dispatch_data;
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais