master - tests: Adapt RAID test to changes
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e12bdd591a1e60f055b...
Commit: e12bdd591a1e60f055baee6cf5e9a144ea245a33
Parent: 7a507583d97c1f4b11d5f1a94958f65cf42b6f9f
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Jul 28 17:36:57 2020 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Jul 28 17:36:57 2020 +0200
tests: Adapt RAID test to changes
Change 3c9177fdc0b8 causes a conversion of raid1 volume to a raid1 with
the same number of legs succeed with a warning.
---
test/shell/lvconvert-m-raid1-degraded.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvconvert-m-raid1-degraded.sh b/test/shell/lvconvert-m-raid1-degraded.sh
index 05c3e893c..c3f70855e 100644
--- a/test/shell/lvconvert-m-raid1-degraded.sh
+++ b/test/shell/lvconvert-m-raid1-degraded.sh
@@ -33,8 +33,10 @@ aux disable_dev "$dev1"
vgreduce --force --removemissing $vg
check raid_leg_status $vg $lv "DA"
-# Conversion to 2 legs must fail on degraded 2-legged raid1 LV
-not lvconvert -y -m1 $vg/$lv
+# Conversion to 2 legs does nothing on degraded 2-legged raid1 LV
+lvconvert -y -m1 $vg/$lv 2>&1 | tee out
+grep "already has 2 images" out
+# Check it remains degraded after the successful "conversion"
check raid_leg_status $vg $lv "DA"
# Repair has to succeed
3 years, 4 months
master - cachevol: add LV type restrictions to command defs
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7a507583d97c1f4b11d...
Commit: 7a507583d97c1f4b11d5f1a94958f65cf42b6f9f
Parent: 085760992dc68efbda8fe8e1ad4a5a2eccef9139
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jul 23 15:10:35 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Jul 23 15:10:35 2020 -0500
cachevol: add LV type restrictions to command defs
LV type restrictions were missed on the command definitions.
---
tools/command-lines.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index e38b6e62f..1b0ca2227 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -498,13 +498,13 @@ FLAGS: SECONDARY_SYNTAX
---
-lvconvert --type writecache --cachedevice PV LV
+lvconvert --type writecache --cachedevice PV LV_linear_striped_raid
OO: OO_LVCONVERT, --cachesize SizeMB, --cachesettings String
ID: lvconvert_to_writecache_with_device
DESC: Add a writecache to an LV, using a specified cache device.
RULE: all and lv_is_visible
-lvconvert --type cache --cachedevice PV LV
+lvconvert --type cache --cachedevice PV LV_linear_striped_raid_thinpool
OO: OO_LVCONVERT, --cachesize SizeMB, --cachesettings String
ID: lvconvert_to_cache_with_device
DESC: Add a cache to an LV, using a specified cache device.
3 years, 4 months
master - cachevol: generate a unique name when creating
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=085760992dc68efbda8...
Commit: 085760992dc68efbda8fe8e1ad4a5a2eccef9139
Parent: 3c9177fdc0b8f94c0ae335790a485477901b685d
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jul 23 13:07:32 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Jul 23 13:18:22 2020 -0500
cachevol: generate a unique name when creating
When a cachevol is automatically created, if the default name
conflicts with an existing name, generate a new unique name.
---
test/shell/cachevol-cachedevice.sh | 10 ++++++++++
tools/lvconvert.c | 14 ++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/test/shell/cachevol-cachedevice.sh b/test/shell/cachevol-cachedevice.sh
index 11a37d9cd..3831ee9d4 100644
--- a/test/shell/cachevol-cachedevice.sh
+++ b/test/shell/cachevol-cachedevice.sh
@@ -208,5 +208,15 @@ lvchange -ay $vg/$lv1
lvchange -an $vg/$lv1
lvremove $vg/$lv1
+# if the cache name is used generate a new name
+lvcreate -n $lv1 -l8 -an $vg @slow
+lvcreate -n ${lv1}_cache -l1 -an $vg @slow
+lvconvert -y --type writecache --cachedevice @fast --cachesize 8M $vg/$lv1
+check lv_field $vg/$lv1 segtype writecache
+check lv_field $vg/${lv1}_cache0_cvol lv_size "8.00m"
+lvchange -ay $vg/$lv1
+lvchange -an $vg/$lv1
+lvremove $vg/$lv1
+
vgremove -ff $vg
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index b6505c1a9..524ed5a33 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4267,6 +4267,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
struct logical_volume **cachevol_lv)
{
char cvname[NAME_LEN];
+ char format[NAME_LEN];
struct dm_list *use_pvh;
struct pv_list *pvl;
char *dev_name;
@@ -4373,6 +4374,19 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
return 0;
}
+ if (find_lv(vg, cvname)) {
+ memset(format, 0, sizeof(cvname));
+ memset(cvname, 0, sizeof(cvname));
+ if (dm_snprintf(format, sizeof(format), "%s_cache%%d", lv->name) < 0) {
+ log_error("Failed to generate cachevol LV format.");
+ return 0;
+ }
+ if (!generate_lv_name(vg, format, cvname, sizeof(cvname))) {
+ log_error("Failed to generate cachevol LV name.");
+ return 0;
+ }
+ }
+
lp.lv_name = cvname;
lp.pvh = use_pvh;
lp.extents = cache_size_sectors / vg->extent_size;
3 years, 4 months
stable-2.02 - lvconvert: display warning if raid1 LV image count does not change
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7f41d49f497e2b886f1...
Commit: 7f41d49f497e2b886f197121551db585dff29b6e
Parent: 61e831aa5e09dfec25d6975f1c9950181c6a71f7
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Jul 20 15:36:25 2020 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jul 20 15:43:31 2020 +0200
lvconvert: display warning if raid1 LV image count does not change
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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index f51e9c401..b805d956c 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -3234,6 +3234,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.",
3 years, 4 months
master - lvconvert: display warning if raid1 LV image count does not change
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3c9177fdc0b8f94c0ae...
Commit: 3c9177fdc0b8f94c0ae335790a485477901b685d
Parent: 119d5947881a8b99640d81592986e508e040766d
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Jul 20 15:36:25 2020 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jul 20 15:42:15 2020 +0200
lvconvert: display warning if raid1 LV image count does not change
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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 3b3e1d373..1ff2a0c85 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -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.",
3 years, 4 months
master - integrity: allow type option to be set when changing mirrors
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=119d5947881a8b99640...
Commit: 119d5947881a8b99640d81592986e508e040766d
Parent: 4667c4b35be03ad0dd6b0dc5aac65ac516af0a0b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jul 15 10:57:05 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 15 10:57:05 2020 -0500
integrity: allow type option to be set when changing mirrors
Allow the optional '--type raid1' to be included in the lvconvert
command when adding or removing raid images with integrity.
It does not change the meaning of the command (specifying a type
that matches the current type is redundant but generally allowed.)
---
tools/command-lines.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index 0051b77b5..e38b6e62f 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -359,7 +359,8 @@ OP: PV ...
ID: lvconvert_raid_types
DESC: Convert LV to raid or change raid layout
DESC: (a specific raid level must be used, e.g. raid1).
-RULE: all not lv_is_locked lv_is_pvmove lv_is_raid_with_integrity
+RULE: all not lv_is_locked lv_is_pvmove
+RULE: lv_is_raid_with_integrity not --stripes_long --stripesize --regionsize --interval
lvconvert --mirrors SNumber LV
OO: --regionsize RegionSize, --interval Number, --mirrorlog MirrorLog, OO_LVCONVERT
3 years, 4 months
master - lvmdbusd: recognize lv attr letter g for integrity
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4667c4b35be03ad0dd6...
Commit: 4667c4b35be03ad0dd6b0dc5aac65ac516af0a0b
Parent: 8f421bdd7ae926ab95921fb36aedc5d35fc894cc
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jul 15 10:07:28 2020 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jul 15 10:07:28 2020 -0500
lvmdbusd: recognize lv attr letter g for integrity
---
daemons/lvmdbusd/lv.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemons/lvmdbusd/lv.py b/daemons/lvmdbusd/lv.py
index fd46f348b..5c4728073 100644
--- a/daemons/lvmdbusd/lv.py
+++ b/daemons/lvmdbusd/lv.py
@@ -388,7 +388,7 @@ class LvCommon(AutomatedProperties):
'l': 'mirror log device', 'c': 'under conversion',
'V': 'thin Volume', 't': 'thin pool', 'T': 'Thin pool data',
'e': 'raid or pool metadata or pool metadata spare',
- 'd': 'vdo pool', 'D': 'vdo pool data',
+ 'd': 'vdo pool', 'D': 'vdo pool data', 'g': 'integrity',
'-': 'Unspecified'}
return self.attr_struct(0, type_map)
3 years, 4 months
stable-2.02 - lvconvert: preset raid1 in case of striped conversions
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=61e831aa5e09dfec25d...
Commit: 61e831aa5e09dfec25d6975f1c9950181c6a71f7
Parent: 7ebe1bc901c3ed9404f92c7415c7c491593aed47
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Jul 13 19:16:45 2020 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jul 13 19:16:47 2020 +0200
lvconvert: preset raid1 in case of striped conversions
Fixed invoking "lvconvert -m+1 $StripedLV" to cause errors
(preset raid conversion implied by '-m').
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1781406
---
WHATS_NEW | 1 +
tools/lvconvert.c | 13 ++++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 846510b28..3db623d6c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.188 -
==================================
+ Fix conversion to raid from striped lagging type.
Fix conversion to 'mirrored' mirror log with larger regionsize.
Fix support for lvconvert --repair used by foreign apps (i.e. Docker).
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 0bc1a0128..fc740fb3e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1336,6 +1336,7 @@ static int _raid4_conversion_supported(struct logical_volume *lv, struct lvconve
static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *lp)
{
int image_count = 0;
+ int type_enforced = 0;
struct cmd_context *cmd = lv->vg->cmd;
struct lv_segment *seg = first_seg(lv);
@@ -1386,6 +1387,12 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
display_lvname(lv));
return 0;
}
+
+ if (!*lp->type_str) {
+ lp->type_str = SEG_TYPE_NAME_RAID1;
+ lp->segtype = get_segtype_from_string(lv->vg->cmd, SEG_TYPE_NAME_RAID1);
+ type_enforced = 1;
+ }
}
if ((lp->corelog || lp->mirrorlog) && strcmp(lp->type_str, SEG_TYPE_NAME_MIRROR)) {
@@ -1400,7 +1407,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
return lv_raid_split(lv, lp->yes, lp->lv_split_name, image_count, lp->pvh);
if (lp->mirrors_supplied) {
- if ((seg_is_striped(seg) && seg->area_count == 1) || seg_is_raid1(seg)) { /* ??? */
+ if (seg_is_linear(seg) || seg_is_raid1(seg)) { /* ??? */
if (!*lp->type_str || !strcmp(lp->type_str, SEG_TYPE_NAME_RAID1) || !strcmp(lp->type_str, SEG_TYPE_NAME_LINEAR) ||
(!strcmp(lp->type_str, SEG_TYPE_NAME_STRIPED) && image_count == 1)) {
if (image_count > DEFAULT_RAID1_MAX_IMAGES) {
@@ -1445,7 +1452,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
/* FIXME This needs changing globally. */
if (!arg_is_set(cmd, stripes_long_ARG))
lp->stripes = 0;
- if (!arg_is_set(cmd, type_ARG))
+ if (!type_enforced && !arg_is_set(cmd, type_ARG))
lp->segtype = NULL;
if (!arg_is_set(cmd, regionsize_ARG))
lp->region_size = 0;
@@ -1467,7 +1474,7 @@ try_new_takeover_or_reshape:
/* FIXME This needs changing globally. */
if (!arg_is_set(cmd, stripes_long_ARG))
lp->stripes = 0;
- if (!arg_is_set(cmd, type_ARG))
+ if (!type_enforced && !arg_is_set(cmd, type_ARG))
lp->segtype = NULL;
if (!lv_raid_convert(lv, lp->segtype,
3 years, 4 months
master - lvconvert: preset raid1 in case of striped conversions
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8f421bdd7ae926ab959...
Commit: 8f421bdd7ae926ab95921fb36aedc5d35fc894cc
Parent: 00c9a788cc617e5e40746dee2e17287d61ee5c81
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Jul 9 18:51:33 2020 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jul 13 19:07:26 2020 +0200
lvconvert: preset raid1 in case of striped conversions
Fixed invoking "lvconvert -m+1 $StripedLV" to cause errors
(preset raid conversion implied by '-m').
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1781406
---
WHATS_NEW | 1 +
tools/lvconvert.c | 13 ++++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 89656a341..562b1765b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.10 -
=================================
+ Fix conversion to raid from striped lagging type.
Fix conversion to 'mirrored' mirror log with larger regionsize.
Zero pool metadata on allocation (disable with allocation/zero_metadata=0).
Failure in zeroing or wiping will fail command (bypass with -Zn, -Wn).
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 2896c67c3..b6505c1a9 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1320,6 +1320,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
{
int image_count = 0;
int images_reduced = 0;
+ int type_enforced = 0;
struct cmd_context *cmd = lv->vg->cmd;
struct lv_segment *seg = first_seg(lv);
@@ -1372,6 +1373,12 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
display_lvname(lv));
return 0;
}
+
+ if (!*lp->type_str) {
+ lp->type_str = SEG_TYPE_NAME_RAID1;
+ lp->segtype = get_segtype_from_string(lv->vg->cmd, SEG_TYPE_NAME_RAID1);
+ type_enforced = 1;
+ }
}
if ((lp->corelog || lp->mirrorlog) && strcmp(lp->type_str, SEG_TYPE_NAME_MIRROR)) {
@@ -1386,7 +1393,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
return lv_raid_split(lv, lp->yes, lp->lv_split_name, image_count, lp->pvh);
if (lp->mirrors_supplied) {
- if ((seg_is_striped(seg) && seg->area_count == 1) || seg_is_raid1(seg)) { /* ??? */
+ if (seg_is_linear(seg) || seg_is_raid1(seg)) { /* ??? */
if (!*lp->type_str || !strcmp(lp->type_str, SEG_TYPE_NAME_RAID1) || !strcmp(lp->type_str, SEG_TYPE_NAME_LINEAR) ||
(!strcmp(lp->type_str, SEG_TYPE_NAME_STRIPED) && image_count == 1)) {
if (image_count > DEFAULT_RAID1_MAX_IMAGES) {
@@ -1449,7 +1456,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
/* FIXME This needs changing globally. */
if (!arg_is_set(cmd, stripes_long_ARG))
lp->stripes = 0;
- if (!arg_is_set(cmd, type_ARG))
+ if (!type_enforced && !arg_is_set(cmd, type_ARG))
lp->segtype = NULL;
if (!arg_is_set(cmd, regionsize_ARG))
lp->region_size = 0;
@@ -1477,7 +1484,7 @@ try_new_takeover_or_reshape:
/* FIXME This needs changing globally. */
if (!arg_is_set(cmd, stripes_long_ARG))
lp->stripes = 0;
- if (!arg_is_set(cmd, type_ARG))
+ if (!type_enforced && !arg_is_set(cmd, type_ARG))
lp->segtype = NULL;
if (!lv_raid_convert(lv, lp->segtype,
3 years, 4 months
master - lvconvert: preset raid1 in case of striped conversions
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a33156365fe59f84c58...
Commit: a33156365fe59f84c588a714ecbd4d24305d6521
Parent: 00c9a788cc617e5e40746dee2e17287d61ee5c81
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Thu Jul 9 18:51:33 2020 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jul 13 19:04:41 2020 +0200
lvconvert: preset raid1 in case of striped conversions
Fixed invoking "lvconvert -m+1 $StripedLV" to cause errors
(preset raid conversion implied by '-m').
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1781406
---
tools/lvconvert.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 2896c67c3..b6505c1a9 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1320,6 +1320,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
{
int image_count = 0;
int images_reduced = 0;
+ int type_enforced = 0;
struct cmd_context *cmd = lv->vg->cmd;
struct lv_segment *seg = first_seg(lv);
@@ -1372,6 +1373,12 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
display_lvname(lv));
return 0;
}
+
+ if (!*lp->type_str) {
+ lp->type_str = SEG_TYPE_NAME_RAID1;
+ lp->segtype = get_segtype_from_string(lv->vg->cmd, SEG_TYPE_NAME_RAID1);
+ type_enforced = 1;
+ }
}
if ((lp->corelog || lp->mirrorlog) && strcmp(lp->type_str, SEG_TYPE_NAME_MIRROR)) {
@@ -1386,7 +1393,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
return lv_raid_split(lv, lp->yes, lp->lv_split_name, image_count, lp->pvh);
if (lp->mirrors_supplied) {
- if ((seg_is_striped(seg) && seg->area_count == 1) || seg_is_raid1(seg)) { /* ??? */
+ if (seg_is_linear(seg) || seg_is_raid1(seg)) { /* ??? */
if (!*lp->type_str || !strcmp(lp->type_str, SEG_TYPE_NAME_RAID1) || !strcmp(lp->type_str, SEG_TYPE_NAME_LINEAR) ||
(!strcmp(lp->type_str, SEG_TYPE_NAME_STRIPED) && image_count == 1)) {
if (image_count > DEFAULT_RAID1_MAX_IMAGES) {
@@ -1449,7 +1456,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
/* FIXME This needs changing globally. */
if (!arg_is_set(cmd, stripes_long_ARG))
lp->stripes = 0;
- if (!arg_is_set(cmd, type_ARG))
+ if (!type_enforced && !arg_is_set(cmd, type_ARG))
lp->segtype = NULL;
if (!arg_is_set(cmd, regionsize_ARG))
lp->region_size = 0;
@@ -1477,7 +1484,7 @@ try_new_takeover_or_reshape:
/* FIXME This needs changing globally. */
if (!arg_is_set(cmd, stripes_long_ARG))
lp->stripes = 0;
- if (!arg_is_set(cmd, type_ARG))
+ if (!type_enforced && !arg_is_set(cmd, type_ARG))
lp->segtype = NULL;
if (!lv_raid_convert(lv, lp->segtype,
3 years, 4 months