summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WHATS_NEW1
-rw-r--r--daemons/clvmd/clvmd-cman.c12
2 files changed, 11 insertions, 2 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 2296e556..18fe06bc 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.34 -
===================================
+ Fix another allocation bug with clvmd and large node IDs.
Add find_lv_in_lv_list() and find_pv_in_pv_list().
Fix uninitialised variable in clvmd that could cause odd hangs.
Add vgmerge tests.
diff --git a/daemons/clvmd/clvmd-cman.c b/daemons/clvmd/clvmd-cman.c
index 47cc4a9b..fc3f3c8a 100644
--- a/daemons/clvmd/clvmd-cman.c
+++ b/daemons/clvmd/clvmd-cman.c
@@ -297,6 +297,8 @@ static void get_members()
{
int retnodes;
int status;
+ int i;
+ int high_nodeid = 0;
num_nodes = cman_get_node_count(c_handle);
if (num_nodes == -1) {
@@ -325,10 +327,16 @@ static void get_members()
exit(6);
}
+ /* Get the highest nodeid */
+ for (i=0; i<retnodes; i++) {
+ if (nodes[i].cn_nodeid > high_nodeid)
+ high_nodeid = nodes[i].cn_nodeid;
+ }
+
if (node_updown == NULL) {
size_t buf_len;
- if (num_nodes > max_updown_nodes)
- max_updown_nodes = num_nodes;
+ if (high_nodeid >= max_updown_nodes)
+ max_updown_nodes = high_nodeid + 1;
buf_len = sizeof(int) * max_updown_nodes;
node_updown = malloc(buf_len);
if (node_updown)