From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32300 invoked by alias); 8 Jul 2009 22:18:14 -0000 Received: (qmail 32293 invoked by alias); 8 Jul 2009 22:18:14 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.6 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 bastion2.fedora.phx.redhat.com Subject: cluster: RHEL5 - clogd: Fix for bugs 474174 and 491340 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: 8df780b532e02acef7f0ebc0113cf96515a7a3b6 X-Git-Newrev: c39f57ec2b16c5e98f3214f6ed0374ab455b8084 From: Jonathan Brassow Message-Id: <20090708221745.850F0120108@lists.fedorahosted.org> Date: Wed, 08 Jul 2009 22:18: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-q3/txt/msg00023.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c39f57ec2b16c5e98f3214f6ed0374ab455b8084 Commit: c39f57ec2b16c5e98f3214f6ed0374ab455b8084 Parent: 8df780b532e02acef7f0ebc0113cf96515a7a3b6 Author: Jonathan Brassow AuthorDate: Wed Jul 8 17:16:19 2009 -0500 Committer: Jonathan Brassow CommitterDate: Wed Jul 8 17:16:19 2009 -0500 clogd: Fix for bugs 474174 and 491340 Whether to continue mirror recovery or not was being queued off of a variable that was set by doing (x - 1). However, when 'x' was 0 the result was a very large number (unsigned). When this large number was compared against the number of total regions in the mirror, it was determined that recovery was finished. The fix is simply to do: y = x ? (x - 1) : 0; instead of: y = (x - 1); --- cmirror/src/functions.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c index 0523e9c..3e0d15f 100644 --- a/cmirror/src/functions.c +++ b/cmirror/src/functions.c @@ -1518,9 +1518,9 @@ static int clog_is_remote_recovering(struct clog_tfr *tfr) /* * Remember, 'lc->sync_search' is 1 plus the region * currently being recovered. So, we must take off 1 - * to account for that. + * to account for that - UNLESS sync_search IS 0! */ - pkg->in_sync_hint = (lc->sync_search - 1); + pkg->in_sync_hint = lc->sync_search ? (lc->sync_search - 1) : 0; LOG_DBG("[%s] Region is %s: %llu", SHORT_UUID(lc->uuid), (region == lc->recovering_region) ?