From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24565 invoked by alias); 6 May 2009 12:09:25 -0000 Received: (qmail 24558 invoked by alias); 6 May 2009 12:09:24 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE3 - cman: use correct nodeid To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 536d9f56e43cfe7cd07aae3c63be1660ec61727b X-Git-Newrev: af7041beaf3ce220fc65e293c4821a4ed8258cc1 From: Christine Caulfield Message-Id: <20090506120824.DEDBE1201E8@lists.fedorahosted.org> Date: Wed, 06 May 2009 12:09:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00227.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=af7041beaf3ce220fc65e293c4821a4ed8258cc1 Commit: af7041beaf3ce220fc65e293c4821a4ed8258cc1 Parent: 536d9f56e43cfe7cd07aae3c63be1660ec61727b Author: Christine Caulfield AuthorDate: Wed May 6 13:05:05 2009 +0100 Committer: Christine Caulfield CommitterDate: Wed May 6 13:05:05 2009 +0100 cman: use correct nodeid The previous cleanups removed a local variable and caused all nodes to take on the nodeid of the last node in cluster.conf This reinstates the local variable, suitably renamed to avoid warnings. Signed-off-by: Christine Caulfield --- cman/daemon/cmanconfig.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cman/daemon/cmanconfig.c b/cman/daemon/cmanconfig.c index e9519a3..8c3f864 100644 --- a/cman/daemon/cmanconfig.c +++ b/cman/daemon/cmanconfig.c @@ -50,6 +50,7 @@ int read_cman_nodes(struct corosync_api_v1 *corosync, unsigned int *config_versi hdb_handle_t nodes_handle; hdb_handle_t find_handle; char *nodename; + int this_nodeid; hdb_handle_t cluster_parent_handle; corosync->object_find_create(OBJECT_PARENT_HANDLE, @@ -86,8 +87,8 @@ int read_cman_nodes(struct corosync_api_v1 *corosync, unsigned int *config_versi } objdb_get_int(corosync, nodes_handle, "votes", (unsigned int *)&votes, 1); - objdb_get_int(corosync, nodes_handle, "nodeid", (unsigned int *)&nodeid, 0); - if (check_nodeids && nodeid == 0) { + objdb_get_int(corosync, nodes_handle, "nodeid", (unsigned int *)&this_nodeid, 0); + if (check_nodeids && this_nodeid == 0) { char message[132]; snprintf(message, sizeof(message), @@ -99,8 +100,8 @@ int read_cman_nodes(struct corosync_api_v1 *corosync, unsigned int *config_versi goto out_err; } - P_MEMB("Got node %s from ccs (id=%d, votes=%d)\n", nodename, nodeid, votes); - add_ccs_node(nodename, nodeid, votes, expected); + P_MEMB("Got node %s from ccs (id=%d, votes=%d)\n", nodename, this_nodeid, votes); + add_ccs_node(nodename, this_nodeid, votes, expected); nodes_handle = nodeslist_next(corosync, find_handle); } while (nodes_handle); corosync->object_find_destroy(find_handle);