From mboxrd@z Thu Jan 1 00:00:00 1970 From: jbrassow@sourceware.org Date: 21 Jun 2006 21:09:49 -0000 Subject: [Cluster-devel] cluster/cmirror-kernel/src dm-cmirror-server.c Message-ID: <20060621210949.8184.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL4 Changes by: jbrassow at sourceware.org 2006-06-21 21:09:49 Modified files: cmirror-kernel/src: dm-cmirror-server.c Log message: - fix for bug 195610 (renaming a clustered mirror is broken) The problem is that LVM2/device-mapper calls the mirror constructor before calling the destructor. This results in two copies of the log context to exist in the cluster mirror. I've added code to detect and handle this, but it should probably also be fixed in LVM2/device-mapper. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-server.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.9&r2=1.1.2.10 --- cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c 2006/06/14 22:14:55 1.1.2.9 +++ cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c 2006/06/21 21:09:49 1.1.2.10 @@ -298,7 +298,6 @@ DMINFO("Disk Resume::"); debug_disk_write = 1; - memset(live_nodes, 0, sizeof(live_nodes)); for(i = 0; i < global_count; i++){ live_nodes[global_nodeids[i]/8] |= 1 << (global_nodeids[i]%8); @@ -612,15 +611,19 @@ static struct log_c *get_log_context(char *uuid){ - struct log_c *lc; + struct log_c *lc, *r = NULL; list_for_each_entry(lc, &log_list_head, log_list){ if(!strncmp(lc->uuid, uuid, MAX_NAME_LEN)){ - return lc; + if (r) + DMERR("HEY!!! There are two matches for %s", + lc->uuid + (strlen(lc->uuid) - 8)); + else + r = lc; } } - return NULL; + return r; }