Skip to contentSkip to conversation

cluster/cmirror/src functions.c

Cluster-devel [email protected] 1 participant 1 message Nov 28, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: jbrassow at sourceware.org 2007-11-28 20:34:22

Modified files:
cmirror/src : functions.c

Log message:
- Bug 387601

- If the sync bit is already set, do not increment the sync_count. This can lead to a sync_count > the number of regions.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/functions.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.4&r2=1.1.2.5

cmirror/src/Attic/functions.c +7 -2
@@ -1147,8 +1147,13 @@
 	lc->recovering_region = (uint64_t)-1;
 
 	if (pkg->in_sync) {
-		log_set_bit(lc, lc->sync_bits, pkg->region);
-		lc->sync_count++;
+		if (log_test_bit(lc->sync_bits, pkg->region)) {
+			LOG_PRINT("  Region already in-sync: %llu",
+				  pkg->region);
+		} else {
+			log_set_bit(lc, lc->sync_bits, pkg->region);
+			lc->sync_count++;
+		}
 	} else if (log_test_bit(lc->sync_bits, pkg->region)) {
 		lc->sync_count--;
 		log_clear_bit(lc, lc->sync_bits, pkg->region);