]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: preserve region size on raid1 image count changes
authorHeinz Mauelshagen <heinzm@redhat.com>
Sat, 22 Apr 2017 00:04:49 +0000 (02:04 +0200)
committerHeinz Mauelshagen <heinzm@redhat.com>
Sat, 22 Apr 2017 00:04:49 +0000 (02:04 +0200)
Unless a change of the regionsize is requested via "lvconvert -R N ...",
keep the region size when the number of images changes in a raid1 LV.

Resolves: rhbz1443705

WHATS_NEW
tools/lvconvert.c

index 5a13744cbd16ebcf7e35367f97631ea82f9ab8d4..efcddd57fa2bcc1218c3d56e4fe727939b727a65 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
 Version 2.02.171 - 
 ==================================
+  lvconvert - preserve region size on raid1 image count changes
+  raid - sanely handle insufficient space on takeover
   Fix configure --enable-notify-dbus status message.
   Change configure option name prefix from --enable-lockd to --enable-lvmlockd.
   lvcreate - raise mirror/raid default regionsize to 2MiB
index 5b9510b9bc2d92756a57e4053811ad7f4cf50212..d5ca6d75da51367dc20b52bc41d5ad1c7a47d490 100644 (file)
@@ -60,6 +60,7 @@ struct lvconvert_params {
        int need_polling;
 
        uint32_t region_size;
+       unsigned region_size_supplied;
 
        uint32_t mirrors;
        sign_t mirrors_sign;
@@ -247,10 +248,13 @@ static int _read_params(struct cmd_context *cmd, struct lvconvert_params *lp)
                                return 0;
                        }
 
-                       if (arg_is_set(cmd, regionsize_ARG))
+                       if (arg_is_set(cmd, regionsize_ARG)) {
                                lp->region_size = arg_uint_value(cmd, regionsize_ARG, 0);
-                       else
+                               lp->region_size_supplied = 1;
+                       } else {
                                lp->region_size = get_default_region_size(cmd);
+                               lp->region_size_supplied = 0;
+                       }
 
                        /* FIXME man page says in one place that --type and --mirrors can't be mixed */
                        if (lp->mirrors_supplied && !lp->mirrors)
@@ -1359,7 +1363,8 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
                                          DEFAULT_RAID1_MAX_IMAGES, lp->segtype->name, display_lvname(lv));
                                return 0;
                        }
-                       if (!lv_raid_change_image_count(lv, lp->yes, image_count, lp->region_size, lp->pvh))
+                       if (!lv_raid_change_image_count(lv, lp->yes, image_count,
+                                                       lp->region_size_supplied ? lp->region_size : seg->region_size , lp->pvh))
                                return_0;
 
                        log_print_unless_silent("Logical volume %s successfully converted.",
This page took 0.052668 seconds and 5 git commands to generate.