1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

raid: don't skip prompt with force

Yes is meant to be used to skip all new prompts.
(--force just adds more prompts).
This commit is contained in:
Zdenek Kabelac 2014-07-01 09:55:04 +02:00
parent c460f35cda
commit 0b872ce870
2 changed files with 8 additions and 15 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.108 - Version 2.02.108 -
================================= =================================
Require --yes to skip raid repair prompt.
Change makefile %.d generation to handle filename changes without make clean. Change makefile %.d generation to handle filename changes without make clean.
Fix use of buildir in make pofile. Fix use of buildir in make pofile.
Enhance private volumes UUIDs with suffixed for easier detection. Enhance private volumes UUIDs with suffixed for easier detection.

View File

@ -1797,12 +1797,11 @@ static int _is_valid_raid_conversion(const struct segment_type *from_segtype,
return 1; return 1;
} }
static void _lvconvert_raid_repair_ask(struct cmd_context *cmd, int *replace_dev) static void _lvconvert_raid_repair_ask(struct cmd_context *cmd,
struct lvconvert_params *lp,
int *replace_dev)
{ {
const char *dev_policy = NULL; const char *dev_policy;
int force = arg_count(cmd, force_ARG);
int yes = arg_count(cmd, yes_ARG);
*replace_dev = 1; *replace_dev = 1;
@ -1818,15 +1817,8 @@ static void _lvconvert_raid_repair_ask(struct cmd_context *cmd, int *replace_dev
return; return;
} }
if (force != PROMPT) { if (!lp->yes &&
*replace_dev = 0; yes_no_prompt("Attempt to replace failed RAID images "
return;
}
if (yes)
return;
if (yes_no_prompt("Attempt to replace failed RAID images "
"(requires full device resync)? [y/n]: ") == 'n') { "(requires full device resync)? [y/n]: ") == 'n') {
*replace_dev = 0; *replace_dev = 0;
} }
@ -1926,7 +1918,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
init_mirror_in_sync(1); init_mirror_in_sync(1);
} }
_lvconvert_raid_repair_ask(cmd, &replace); _lvconvert_raid_repair_ask(cmd, lp, &replace);
if (replace) { if (replace) {
if (!(failed_pvs = _failed_pv_list(lv->vg))) if (!(failed_pvs = _failed_pv_list(lv->vg)))