[lvm-devel] master - raid: reread status when 0 is reported

Zdenek Kabelac zkabelac at fedoraproject.org
Mon May 4 11:12:36 UTC 2015


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=88421c883ebe20730e31e601d209f48b64b14ad0
Commit:        88421c883ebe20730e31e601d209f48b64b14ad0
Parent:        2d10a6f6aef9eb013986c40a8bd83db6f571472f
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Mon May 4 11:25:00 2015 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Mon May 4 13:09:05 2015 +0200

raid: reread status when 0 is reported

When kernel target reports sync status as 0%  it might as well mean
it's 100% in sync, just the target is in some race inconsistent
state - so reread once again and take a more optimistic value ;)

Patch tries to work around:
https://bugzilla.redhat.com/show_bug.cgi?id=1210637
---
 lib/metadata/raid_manip.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index c786e89..0428eb0 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -93,6 +93,20 @@ static int _raid_in_sync(struct logical_volume *lv)
 			  lv->vg->name, lv->name);
 		return 0;
 	}
+	if (sync_percent == DM_PERCENT_0) {
+		/*
+		 * Repeat read of status once more - since buggy kernel target
+		 * sometimes reports 0 even though the array is in 100% sync
+		 */
+		if (!lv_raid_percent(lv, &sync_percent)) {
+			log_error("Unable to determine sync status of %s/%s.",
+				  lv->vg->name, lv->name);
+			return 0;
+		}
+		if (sync_percent == DM_PERCENT_100)
+			log_warn("WARNING: Sync status for %s is inconsistent.",
+				 display_lvname(lv));
+	}
 
 	return (sync_percent == DM_PERCENT_100) ? 1 : 0;
 }




More information about the lvm-devel mailing list