1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvchange: allow a transiently failed RaidLV to be refreshed

Enhance commit 0b8bf73a63 to refresh the top-level LV correctly
in case of a clustered, remotely activated RaidLV.

Related: rhbz1399844
This commit is contained in:
Heinz Mauelshagen 2016-12-12 22:06:17 +01:00
parent 75ec7c8dee
commit 87117c2b25

View File

@ -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;
}
}
}