diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-05-04 11:25:00 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-05-04 13:09:05 +0200 |
commit | 88421c883ebe20730e31e601d209f48b64b14ad0 (patch) | |
tree | ce617af61c7eb272d783ec693f1a0fe839a4c298 | |
parent | 2d10a6f6aef9eb013986c40a8bd83db6f571472f (diff) | |
download | lvm2-88421c883ebe20730e31e601d209f48b64b14ad0.tar.gz |
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
-rw-r--r-- | 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 c786e8992..0428eb09f 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; } |