mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
pools: prompt only when metadata lv exists
If the VG has no pool metadata volume, don't prompt about removal of _pmspare.
This commit is contained in:
parent
138c2417c0
commit
09e32e4add
@ -1,5 +1,6 @@
|
||||
Version 2.02.112 -
|
||||
=====================================
|
||||
Don't prompt for removal of _pmspare in VG without pool metadata LV.
|
||||
Deactivation of snapshot origin detects and deactivates left-over snapshots.
|
||||
Properly report error when taking snapshot of any cache type LV.
|
||||
Add basic thread debugging messages to dmeventd.
|
||||
|
@ -5570,6 +5570,7 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
|
||||
dm_percent_t snap_percent;
|
||||
struct dm_list *snh, *snht;
|
||||
struct lvinfo info;
|
||||
struct lv_list *lvl;
|
||||
struct logical_volume *origin;
|
||||
|
||||
if (lv_is_cow(lv)) {
|
||||
@ -5649,12 +5650,17 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume *
|
||||
return_0;
|
||||
|
||||
if (lv_is_pool_metadata_spare(lv) &&
|
||||
(force == PROMPT) &&
|
||||
(yes_no_prompt("Removal of pool metadata spare logical volume"
|
||||
" \"%s\" disables automatic recovery attempts"
|
||||
" after damage to a thin or cache pool."
|
||||
" Proceed? [y/n]: ", lv->name) == 'n'))
|
||||
goto no_remove;
|
||||
(force == PROMPT)) {
|
||||
dm_list_iterate_items(lvl, &lv->vg->lvs)
|
||||
if (lv_is_pool_metadata(lvl->lv)) {
|
||||
if (yes_no_prompt("Removal of pool metadata spare logical volume"
|
||||
" \"%s\" disables automatic recovery attempts"
|
||||
" after damage to a thin or cache pool."
|
||||
" Proceed? [y/n]: ", lv->name) == 'n')
|
||||
goto no_remove;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return lv_remove_single(cmd, lv, force, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user