]> sourceware.org Git - lvm2.git/commitdiff
raid: move VG update after archiving happened
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 6 Mar 2018 12:38:00 +0000 (13:38 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 6 Mar 2018 14:38:15 +0000 (15:38 +0100)
Update of LV le_count needs to happen after archive().

WHATS_NEW
lib/metadata/lv_manip.c

index 52cf4bc7661f11bf5d332cb2d2e88ea9cb719fb2..49b995e29a698ea52aa4dc3f9d2b471e858e7ff3 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.178 - 
 =====================================
+  Do not modify archived metadata when removing striped raid.
   Fix memleak on error path when obtaining lv_raid_data_offset.
   Fix compatibility size test of extended external origin.
   Add external_origin visiting in for_each_sub_lv().
index 044214c542f82c1010b1bd68e7629e2efcb709f0..88b0d9d93f223b271625d1fa3997f71b215ef2d9 100644 (file)
@@ -6077,13 +6077,6 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
                is_last_pool = 1;
        }
 
-       /* Special case removing a striped raid LV with allocated reshape space */
-       if (seg && seg->reshape_len) {
-               if (!(seg->segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_STRIPED)))
-                       return_0;
-               lv->le_count = seg->len = seg->area_len = seg_lv(seg, 0)->le_count * seg->area_count;
-       }
-
        /* Used cache pool, COW or historical LV cannot be activated */
        if (!lv_is_used_cache_pool(lv) &&
            !lv_is_cow(lv) && !lv_is_historical(lv) &&
@@ -6097,6 +6090,13 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
        if (!archive(vg))
                return 0;
 
+       /* Special case removing a striped raid LV with allocated reshape space */
+       if (seg && seg->reshape_len) {
+               if (!(seg->segtype = get_segtype_from_string(cmd, SEG_TYPE_NAME_STRIPED)))
+                       return_0;
+               lv->le_count = seg->len = seg->area_len = seg_lv(seg, 0)->le_count * seg->area_count;
+       }
+
        /* Clear thin pool stacked messages */
        if (pool_lv && !pool_has_message(first_seg(pool_lv), lv, 0) &&
            !update_pool_lv(pool_lv, 1)) {
This page took 0.105995 seconds and 5 git commands to generate.