From 87117c2b2546231c789f92c75590f053a8fb987c Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Mon, 12 Dec 2016 22:06:17 +0100 Subject: [PATCH] lvchange: allow a transiently failed RaidLV to be refreshed Enhance commit 0b8bf73a63d8 to refresh the top-level LV correctly in case of a clustered, remotely activated RaidLV. Related: rhbz1399844 --- lib/metadata/lv_manip.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 120217fac..fdfee366f 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -1417,17 +1417,23 @@ int lv_refresh_suspend_resume(const struct logical_volume *lv) * with transient failures of SubLVs. */ if (lv_is_raid(lv)) { - uint32_t s; - struct lv_segment *seg = first_seg(lv); + if (vg_is_clustered(lv->vg) && + lv_is_active_remotely(lv)) { + if (!_lv_refresh_suspend_resume(lv)) + return 0; + } else { + uint32_t s; + struct lv_segment *seg = first_seg(lv); - for (s = 0; s < seg->area_count; s++) { - if (seg_type(seg, s) == AREA_LV && - !_lv_refresh_suspend_resume(seg_lv(seg, s))) - return 0; - if (seg->meta_areas && - seg_metatype(seg, s) == AREA_LV && - !_lv_refresh_suspend_resume(seg_metalv(seg, s))) - return 0; + for (s = 0; s < seg->area_count; s++) { + if (seg_type(seg, s) == AREA_LV && + !_lv_refresh_suspend_resume(seg_lv(seg, s))) + return 0; + if (seg->meta_areas && + seg_metatype(seg, s) == AREA_LV && + !_lv_refresh_suspend_resume(seg_metalv(seg, s))) + return 0; + } } }