d49338dc97
- some Fixes from upstream(bsc#1043045) Added: 0004-main-Display-reason-why-cluster-cannot-be-formed.patch 0005-votequorum-Report-errors-from-votequorum_exec_send_r.patch 0006-coroapi-Use-size_t-for-private_data_size.patch OBS-URL: https://build.opensuse.org/request/show/501563 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=90
81 lines
3.1 KiB
Diff
81 lines
3.1 KiB
Diff
From c1d0a5fe6380b007dd31f85a07b4aaca57eb14a2 Mon Sep 17 00:00:00 2001
|
|
From: Bin Liu <bliu@suse.com>
|
|
Date: Wed, 7 Jun 2017 13:46:25 +0800
|
|
Subject: [PATCH] votequorum: Report errors from
|
|
votequorum_exec_send_reconfigure
|
|
|
|
If votequorum_exec_send_reconfigure() returns an error (ie the
|
|
packet could not be sent) then we should either return it to the
|
|
sender (for a library call) or, for an internal call, log it.
|
|
---
|
|
exec/votequorum.c | 30 ++++++++++++++++++++----------
|
|
1 file changed, 20 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/exec/votequorum.c b/exec/votequorum.c
|
|
index d29a717f..e85c07d3 100644
|
|
--- a/exec/votequorum.c
|
|
+++ b/exec/votequorum.c
|
|
@@ -1559,8 +1559,10 @@ static void votequorum_refresh_config(
|
|
if (strcmp(key_name, "quorum.cancel_wait_for_all") == 0 &&
|
|
cancel_wfa >= 1) {
|
|
icmap_set_uint8("quorum.cancel_wait_for_all", 0);
|
|
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA,
|
|
- us->node_id, 0);
|
|
+ if (votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA,
|
|
+ us->node_id, 0)) {
|
|
+ log_printf(LOGSYS_LEVEL_ERROR, "Failed to send Cancel WFA message to other nodes");
|
|
+ }
|
|
return;
|
|
}
|
|
|
|
@@ -1578,12 +1580,16 @@ static void votequorum_refresh_config(
|
|
votequorum_exec_send_nodeinfo(us->node_id);
|
|
votequorum_exec_send_nodeinfo(VOTEQUORUM_QDEVICE_NODEID);
|
|
if (us->votes != old_votes) {
|
|
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES,
|
|
- us->node_id, us->votes);
|
|
+ if(votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES,
|
|
+ us->node_id, us->votes)) {
|
|
+ log_printf(LOGSYS_LEVEL_ERROR, "Failed to send new votes message to other nodes");
|
|
+ }
|
|
}
|
|
if (us->expected_votes != old_expected_votes) {
|
|
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES,
|
|
- us->node_id, us->expected_votes);
|
|
+ if(votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES,
|
|
+ us->node_id, us->expected_votes)) {
|
|
+ log_printf(LOGSYS_LEVEL_ERROR, "Failed to send new votes message to other nodes");
|
|
+ }
|
|
}
|
|
|
|
LEAVE();
|
|
@@ -2610,8 +2616,10 @@ static void message_handler_req_lib_votequorum_setexpected (void *conn, const vo
|
|
goto error_exit;
|
|
}
|
|
|
|
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES, us->node_id,
|
|
- req_lib_votequorum_setexpected->expected_votes);
|
|
+ if(votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES, us->node_id,
|
|
+ req_lib_votequorum_setexpected->expected_votes)) {
|
|
+ error = CS_ERR_NO_RESOURCES;
|
|
+ }
|
|
|
|
error_exit:
|
|
res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
|
|
@@ -2657,8 +2665,10 @@ static void message_handler_req_lib_votequorum_setvotes (void *conn, const void
|
|
goto error_exit;
|
|
}
|
|
|
|
- votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES, nodeid,
|
|
- req_lib_votequorum_setvotes->votes);
|
|
+ if(votequorum_exec_send_reconfigure(VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES, nodeid,
|
|
+ req_lib_votequorum_setvotes->votes)) {
|
|
+ error = CS_ERR_NO_RESOURCES;
|
|
+ }
|
|
|
|
error_exit:
|
|
res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
|
|
--
|
|
2.12.0
|
|
|