1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-09-14 09:44:18 +03:00

Make clvmd cope with large gaps in nodeIDs

This commit is contained in:
Patrick Caulfield
2004-09-30 14:18:29 +00:00
parent 896318f475
commit cf54177475
2 changed files with 8 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
Version 2.00.26 - Version 2.00.26 -
===================================== =====================================
Make clvmd fork later so it can return more error codes.
Make clvmd cope with large gaps in node numbers IDs.
Version 2.00.25 - 29th September 2004 Version 2.00.25 - 29th September 2004
===================================== =====================================

View File

@@ -257,17 +257,18 @@ void add_up_node(char *csid)
int nodeid = nodeid_from_csid(csid); int nodeid = nodeid_from_csid(csid);
if (nodeid >= max_updown_nodes) { if (nodeid >= max_updown_nodes) {
int *new_updown = realloc(node_updown, max_updown_nodes + 10); int new_size = nodeid + 10;
int *new_updown = realloc(node_updown, new_size);
if (new_updown) { if (new_updown) {
node_updown = new_updown; node_updown = new_updown;
max_updown_nodes += 10; max_updown_nodes = new_size;
DEBUGLOG("realloced more space for nodes. now %d\n", DEBUGLOG("realloced more space for nodes. now %d\n",
max_updown_nodes); max_updown_nodes);
} else { } else {
log_error log_error
("Realloc failed. Node status for clvmd will be wrong\n"); ("Realloc failed. Node status for clvmd will be wrong. quitting\n");
return; exit(999);
} }
} }
node_updown[nodeid] = 1; node_updown[nodeid] = 1;