This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RHEL53 - clogd: Fix for bug 468911 - sync %'age can go over 100%


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=45aa6ec5439ae18987fa3134e7b8275947e25486
Commit:        45aa6ec5439ae18987fa3134e7b8275947e25486
Parent:        3807bbaaa8f7648c3150ef467de1b4da9e9447e2
Author:        Jonathan Brassow <jbrassow@redhat.com>
AuthorDate:    Mon Nov 3 09:39:37 2008 -0600
Committer:     Jonathan Brassow <jbrassow@redhat.com>
CommitterDate: Mon Nov 3 09:42:06 2008 -0600

clogd:  Fix for bug 468911 - sync %'age can go over 100%

Bitmaps are created in 32-bit chunk sizes, but the needed
number of bits is not always a multiple of this.  Sometimes,
the extra remaining bits could be set and erroneously
counted.  Generally a harmless error, but for those looking
for 100% completion, it might surprise them (or scripts) to
get something larger.
---
 cmirror/src/functions.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c
index df8cc8a..a76318a 100644
--- a/cmirror/src/functions.c
+++ b/cmirror/src/functions.c
@@ -786,19 +786,17 @@ no_disk:
 		lc->touched = 0;
 	}
 out:
-	lc->sync_count = count_bits32(lc->sync_bits, lc->bitset_uint32_count);
-	if (lc->sync_count > lc->region_count)
-		LOG_ERROR("[%s]  clog_resume: (lc->sync_count > lc->region_count)",
-			  SHORT_UUID(lc->uuid));
-	if (lc->region_count % 32) {
-		if (log_test_bit(lc->sync_bits, lc->region_count))
-			LOG_ERROR("[%s]  clog_resume: log_test_bit(lc->sync_bits, lc->region_count)",
-				  SHORT_UUID(lc->uuid));
-		if (log_test_bit(lc->clean_bits, lc->region_count))
-			LOG_ERROR("[%s]  clog_resume: log_test_bit(lc->clean_bits, lc->region_count)",
-				  SHORT_UUID(lc->uuid));
+	/*
+	 * Clear any old bits if device has shrunk - necessary
+	 * for non-master resume
+	 */
+	for (i = lc->region_count; i % 32; i++) {
+		log_clear_bit(lc, lc->clean_bits, i);
+		log_clear_bit(lc, lc->sync_bits, i);
 	}
 
+	lc->sync_count = count_bits32(lc->sync_bits, lc->bitset_uint32_count);
+
 	LOG_DBG("[%s] Initial sync_count = %llu",
 		SHORT_UUID(lc->uuid), (unsigned long long)lc->sync_count);
 	lc->sync_search = 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]