From 1ee5e18a7b446bc08d99a5638fc4463e459b34d3 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 26 Aug 2014 11:53:56 +0200 Subject: [PATCH] thin: more forced ignoring of pool failure Support also 'vgremove -ff' to properly remove even inactive/broken thin pools. Update messages to use 'print_unless_silent' for the forced case. --- WHATS_NEW | 1 + lib/metadata/lv_manip.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index c42d1d588..13e61292d 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.110 - ================================== + Support lv/vgremove -ff to remove thin vols from broken/inactive thin pools. Fix typo breaking configure --with-lvm1=shared. Modify lvresize code to handle raid/mirrors and physical extents. Allow conversion of raid1 LV into a snapshot LV or snapshot origin LV. diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index fa91c4e27..5cc007972 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -5522,11 +5522,11 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, if (pool_lv && !pool_has_message(first_seg(pool_lv), lv, 0) && !update_pool_lv(pool_lv, 1)) { if (force < DONT_PROMPT_OVERRIDE) { - log_error("Failed to update thin pool %s.", pool_lv->name); + log_error("Failed to update pool %s.", display_lvname(pool_lv)); return 0; } - log_warn("WARNING: Forced to ignoring failure of pool metadata update %s.", - pool_lv->name); + log_print_unless_silent("Ignoring update failure of pool %s.", + display_lvname(pool_lv)); pool_lv = NULL; /* Do not retry */ } @@ -5565,8 +5565,12 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, /* Release unneeded blocks in thin pool */ /* TODO: defer when multiple LVs relased at once */ if (pool_lv && !update_pool_lv(pool_lv, 1)) { - log_error("Failed to update thin pool %s.", pool_lv->name); - return 0; + if (force < DONT_PROMPT_OVERRIDE) { + log_error("Failed to update pool %s.", display_lvname(pool_lv)); + return 0; + } + log_print_unless_silent("Ignoring update failure of pool %s.", + display_lvname(pool_lv)); } backup(vg);