All of lore.kernel.org
 help / color / mirror / Atom feed
From: ccaulfield@sourceware.org <ccaulfield@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW daemons/clvmd/clvmd-cman.c
Date: 1 Apr 2008 15:01:30 -0000	[thread overview]
Message-ID: <20080401150130.26704.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	ccaulfield at sourceware.org	2008-04-01 15:01:30

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-cman.c 

Log message:
	Fix another allocation bug with clvmd and large node IDs.`

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.812&r2=1.813
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-cman.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22

--- LVM2/WHATS_NEW	2008/03/28 19:08:23	1.812
+++ LVM2/WHATS_NEW	2008/04/01 15:01:30	1.813
@@ -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.
--- LVM2/daemons/clvmd/clvmd-cman.c	2008/03/25 10:41:59	1.21
+++ LVM2/daemons/clvmd/clvmd-cman.c	2008/04/01 15:01:30	1.22
@@ -297,6 +297,8 @@
 {
 	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 @@
 		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)



             reply	other threads:[~2008-04-01 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 15:01 ccaulfield [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-05-09  7:20 LVM2 ./WHATS_NEW daemons/clvmd/clvmd-cman.c ccaulfield
2008-03-25 10:42 ccaulfield
2007-05-02  8:23 pcaulfield
2007-04-23 14:55 pcaulfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080401150130.26704.qmail@sourceware.org \
    --to=ccaulfield@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.