]> sourceware.org Git - lvm2.git/commitdiff
lvchange: allow a transiently failed RaidLV to be refreshed
authorHeinz Mauelshagen <heinzm@redhat.com>
Mon, 12 Dec 2016 21:06:17 +0000 (22:06 +0100)
committerHeinz Mauelshagen <heinzm@redhat.com>
Mon, 12 Dec 2016 21:08:47 +0000 (22:08 +0100)
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

index 120217fac13d44b6796584cea1676b888bb04f20..fdfee366f7330b683a77ee1d95ed24cb15f05388 100644 (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);
-
-               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)))
+               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;
+                       }
                }
        }
 
This page took 0.046888 seconds and 5 git commands to generate.