public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Brassow <jbrassow@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: RHEL54 - clogd: Fix for bugs 474174 and 491340
Date: Wed, 08 Jul 2009 22:21:00 -0000	[thread overview]
Message-ID: <20090708222046.6C901120108@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6cf7dbc393d206e56a14261af81b1aeeb5bb160a
Commit:        6cf7dbc393d206e56a14261af81b1aeeb5bb160a
Parent:        704f137b77fce75d27621b1571bbb142696d30d6
Author:        Jonathan Brassow <jbrassow@redhat.com>
AuthorDate:    Wed Jul 8 17:16:19 2009 -0500
Committer:     Jonathan Brassow <jbrassow@redhat.com>
CommitterDate: Wed Jul 8 17:19:46 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 45fdc1a..d37c75a 100644
--- a/cmirror/src/functions.c
+++ b/cmirror/src/functions.c
@@ -1505,9 +1505,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) ?


                 reply	other threads:[~2009-07-08 22:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090708222046.6C901120108@lists.fedorahosted.org \
    --to=jbrassow@fedoraproject.org \
    --cc=cluster-cvs-relay@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).