diff --git a/WHATS_NEW b/WHATS_NEW index b2796f67b..305e185d2 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.172 - =============================== + Improve raid status reporting with lvs. No longer necessary to '--force' a repair for RAID1 Linear to RAID1 upconverts now use "recover" sync action, not "resync". Improve lvcreate --cachepool arg validation. diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c index b24c4aa12..555df1ab0 100644 --- a/lib/metadata/lv.c +++ b/lib/metadata/lv.c @@ -395,6 +395,15 @@ dm_percent_t lvseg_percent_with_info_and_seg_status(const struct lv_with_info_an } } break; + case SEG_STATUS_RAID: + switch (type) { + case PERCENT_GET_DIRTY: + p = dm_make_percent(s->raid->insync_regions, s->raid->total_regions); + break; + default: + p = DM_PERCENT_INVALID; + } + break; case SEG_STATUS_SNAPSHOT: if (s->snapshot->merge_failed) p = DM_PERCENT_INVALID; diff --git a/lib/report/report.c b/lib/report/report.c index d9880b206..f61776ede 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -3079,11 +3079,13 @@ static int _copypercent_disp(struct dm_report *rh, dm_percent_t percent = DM_PERCENT_INVALID; /* TODO: just cache passes through lvseg_percent... */ - if (lv_is_cache(lv) || lv_is_used_cache_pool(lv)) + if (lv_is_cache(lv) || lv_is_used_cache_pool(lv) || + (!lv_is_merging_origin(lv) && lv_is_raid(lv) && !seg_is_any_raid0(first_seg(lv)))) percent = lvseg_percent_with_info_and_seg_status(lvdm, PERCENT_GET_DIRTY); - else if (((lv_is_raid(lv) && !seg_is_any_raid0(first_seg(lv)) && - lv_raid_percent(lv, &percent)) || - (lv_is_mirror(lv) && + else if (lv_is_raid(lv) && !seg_is_any_raid0(first_seg(lv))) + /* old way for percentage when merging snapshot into raid origin */ + (void) lv_raid_percent(lv, &percent); + else if (((lv_is_mirror(lv) && lv_mirror_percent(lv->vg->cmd, lv, 0, &percent, NULL))) && (percent != DM_PERCENT_INVALID)) percent = copy_percent(lv);