From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9651 invoked by alias); 11 Feb 2009 15:57:30 -0000 Received: (qmail 9643 invoked by alias); 11 Feb 2009 15:57:30 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.5 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 bastion.fedora.phx.redhat.com Subject: cluster: RHEL5 - clogd: Initialize list structs before adding to list. To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: 864eb5eb988f9036759f58d651754ec0831675d5 X-Git-Newrev: 948e49365049e7540d5c5702c1885ff8f1887619 From: Jonathan Brassow Message-Id: <20090211155704.E316F120199@lists.fedorahosted.org> Date: Wed, 11 Feb 2009 15:57: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-q1/txt/msg00434.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=948e49365049e7540d5c5702c1885ff8f1887619 Commit: 948e49365049e7540d5c5702c1885ff8f1887619 Parent: 864eb5eb988f9036759f58d651754ec0831675d5 Author: Jonathan Brassow AuthorDate: Wed Feb 11 09:56:28 2009 -0600 Committer: Jonathan Brassow CommitterDate: Wed Feb 11 09:56:28 2009 -0600 clogd: Initialize list structs before adding to list. If we don't initialize newly allocated list structures, we can corrupt the working linked list. --- cmirror/src/cluster.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/cmirror/src/cluster.c b/cmirror/src/cluster.c index 483ed1d..7711b28 100644 --- a/cmirror/src/cluster.c +++ b/cmirror/src/cluster.c @@ -927,6 +927,7 @@ static void cpg_message_callback(cpg_handle_t handle, struct cpg_name *gname, return; } memcpy(tmp_tfr, tfr, sizeof(*tfr) + tfr->data_size); + INIT_LIST_HEAD((struct list_head *)&tmp_tfr->private); list_add_tail((struct list_head *)&tmp_tfr->private, &match->working_list); } @@ -1023,6 +1024,7 @@ static void cpg_message_callback(cpg_handle_t handle, struct cpg_name *gname, memcpy(tmp_tfr, tfr, sizeof(*tfr) + tfr->data_size); tmp_tfr->error = match->lowest_id; + INIT_LIST_HEAD((struct list_head *)&tmp_tfr->private); list_add_tail((struct list_head *)&tmp_tfr->private, &match->startup_list); goto out; @@ -1146,6 +1148,7 @@ static void cpg_join_callback(struct clog_cpg *match, } tfr->request_type = DM_CLOG_MEMBER_JOIN; tfr->originator = joined->nodeid; + INIT_LIST_HEAD((struct list_head *)&tfr->private); list_add_tail((struct list_head *)&tfr->private, &match->startup_list); out: