From 2b18be87aa7cc1439e8b138690f79dd4eed73afc Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 23 Jun 2017 22:50:19 +0200 Subject: [PATCH] raid: recognize transient failed raid leg When raid leg rimage device is marked as 'D'ead by mdcore, lvm2 was not able to replace such device with allocate policy, as device has not appared as missing. Add detection of transiently failing devices. --- WHATS_NEW | 1 + lib/metadata/raid_manip.c | 2 ++ tools/lvconvert.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 19f7a3156..fa51f6719 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.172 - =============================== + Lvconvert --repair handles failing raid legs (present but marked 'D'ead). Do not lvdisplay --maps unset settings of cache pool. Fix lvdisplay --maps for cache pool without policy settings. Support aborting of flushing cache LV. diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index c94397679..2a427ab93 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -6653,6 +6653,8 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv, if (lv_is_virtual(seg_lv(raid_seg, s)) || lv_is_virtual(seg_metalv(raid_seg, s)) || + lv_is_partial(seg_lv(raid_seg, s)) || + lv_is_partial(seg_metalv(raid_seg, s)) || lv_is_on_pvs(seg_lv(raid_seg, s), remove_pvs) || lv_is_on_pvs(seg_metalv(raid_seg, s), remove_pvs)) { match_count++; diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 821146f10..5e255d333 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -3319,6 +3319,8 @@ static int _lvconvert_repair_pvs_raid(struct cmd_context *cmd, struct logical_vo return 0; } + lv_check_transient(lv); /* TODO check this in lib for all commands? */ + _lvconvert_repair_pvs_raid_ask(cmd, &do_it); if (do_it) {