]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: display warning if raid1 LV image count does not change
authorHeinz Mauelshagen <heinzm@redhat.com>
Mon, 20 Jul 2020 13:36:25 +0000 (15:36 +0200)
committerHeinz Mauelshagen <heinzm@redhat.com>
Mon, 20 Jul 2020 13:42:15 +0000 (15:42 +0200)
Fix "lvconvert -mN $RaidLV" to display a warning in
case the same number of images is being requested.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1774696

lib/metadata/raid_manip.c

index 3b3e1d373b0291e3ebfcfb732db0b9fd478b6bcc..1ff2a0c85c766b8478d867e6b2287078aa584cd7 100644 (file)
@@ -3229,6 +3229,11 @@ int lv_raid_change_image_count(struct logical_volume *lv, int yes, uint32_t new_
        const char *level = seg->area_count == 1 ? "raid1 with " : "";
        const char *resil = new_count < seg->area_count ? "reducing" : "enhancing";
 
+       if (new_count == seg->area_count) {
+               log_warn("Type %s LV %s already has %u images.", lvseg_name(seg), display_lvname(lv), new_count);
+               return 1;
+       }
+
        /* LV must be active to perform raid conversion operations */
        if (!lv_is_active(lv)) {
                log_error("%s must be active to perform this operation.",
This page took 0.045813 seconds and 5 git commands to generate.