[PATCH 1/2] votequorum: fix send_nodeinfo data overwrite and clear info on unregister

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




From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

this affects only qdevice

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
 exec/votequorum.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/exec/votequorum.c b/exec/votequorum.c
index 83f4488..3765a69 100644
--- a/exec/votequorum.c
+++ b/exec/votequorum.c
@@ -1144,7 +1144,7 @@ static int votequorum_exec_send_nodeinfo(uint32_t nodeid)
 	req_exec_quorum_nodeinfo.votes = node->votes;
 	req_exec_quorum_nodeinfo.expected_votes = node->expected_votes;
 	req_exec_quorum_nodeinfo.flags = node->flags;
-	if (qdevice_is_registered) {
+	if ((nodeid != NODEID_QDEVICE) && (qdevice_is_registered)) {
 		strcpy(req_exec_quorum_nodeinfo.qdevice_name, qdevice->qdevice_name);
 	} else {
 		memset(req_exec_quorum_nodeinfo.qdevice_name, 0, VOTEQUORUM_MAX_QDEVICE_NAME_LEN);
@@ -1980,6 +1980,8 @@ static void message_handler_req_lib_votequorum_qdevice_unregister (void *conn,
 		qdevice_is_registered = 0;
 		us->flags &= ~NODE_FLAGS_QDEVICE;
 		us->flags &= ~NODE_FLAGS_QDEVICE_STATE;
+		qdevice->state = NODESTATE_DEAD;
+		memset(qdevice->qdevice_name, 0, VOTEQUORUM_MAX_QDEVICE_NAME_LEN);
 		votequorum_exec_send_nodeinfo(us->node_id);
 	} else {
 		error = CS_ERR_NOT_EXIST;
-- 
1.7.7.6

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


[Corosync Project]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux