1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvconvert: raid1 -> linear prompt

Avoid 2 prompts when downconverting raid1 to linear
(related commit 0f65d7ec3a).
This commit is contained in:
Heinz Mauelshagen 2017-04-06 19:24:11 +02:00
parent 3b1a96b9b3
commit 653bca6811

View File

@ -3000,9 +3000,10 @@ int lv_raid_change_image_count(struct logical_volume *lv, int yes, uint32_t new_
{
struct lv_segment *seg = first_seg(lv);
const char *level = seg->area_count == 1 ? "raid1 with " : "";
const char *resil = new_count == 1 ? " loosing all" : (new_count < seg->area_count ? "s reducing" : "s enhancing");
const char *resil = new_count < seg->area_count ? "reducing" : "enhancing";
if (!yes && yes_no_prompt("Are you sure you want to convert %s LV %s to %s%u image%s resilience? [y/n]: ",
if (new_count != 1 && /* Already prompted for in _raid_remove_images() */
!yes && yes_no_prompt("Are you sure you want to convert %s LV %s to %s%u images %s resilience? [y/n]: ",
lvseg_name(first_seg(lv)), display_lvname(lv), level, new_count, resil) == 'n') {
log_error("Logical volume %s NOT converted.", display_lvname(lv));
return 0;