mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-28 02:50:41 +03:00
lvconvert: Reinstate mirror to raid conversions.
Reinstate conversions from mirror to raid stopped by commit 46c8d6bb8ae91ee67c8633496cc6c3d92bb4f3ce (lvconvert: Improve message for raid without -m).
This commit is contained in:
parent
3bbf89e9ec
commit
aec58c8620
@ -242,9 +242,9 @@ static int _check_conversion_type(struct cmd_context *cmd, const char *type_str)
|
||||
if (!type_str || !*type_str)
|
||||
return 1;
|
||||
|
||||
if (!strcmp(type_str, "mirror") || !strncmp(type_str, "raid", 4)) {
|
||||
if (!strcmp(type_str, "mirror")) {
|
||||
if (!arg_count(cmd, mirrors_ARG)) {
|
||||
log_error("Mirror and raid conversions require -m/--mirrors");
|
||||
log_error("Conversions to --type mirror require -m/--mirrors");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
@ -1734,6 +1734,11 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (seg_is_linear(seg) && !arg_count(cmd, mirrors_ARG)) {
|
||||
log_error("Raid conversions require -m/--mirrors");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Change number of RAID1 images */
|
||||
if (arg_count(cmd, mirrors_ARG) || arg_count(cmd, splitmirrors_ARG)) {
|
||||
image_count = lv_raid_image_count(lv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user