From f2365e3e82309056c2921016584a56210da6888b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 11 Jan 2018 10:46:04 +0100 Subject: [PATCH 19/25] cleanup: enhance messages Add extra info about failing local exlusive activation (as in cluster the LV can be active on some other nodes). (cherry picked from commit 38b81e6537a8dc497a4bc616a1f51632b43137ca) --- lib/locking/locking.c | 3 ++- tools/pvmove.c | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/locking/locking.c b/lib/locking/locking.c index c68d4c7..8daa61e 100644 --- a/lib/locking/locking.c +++ b/lib/locking/locking.c @@ -406,7 +406,8 @@ int activate_lvs(struct cmd_context *cmd, struct dm_list *lvs) dm_list_iterate_items(lvl, lvs) { if (!activate_lv_excl_local(cmd, lvl->lv)) { - log_error("Failed to activate %s", display_lvname(lvl->lv)); + log_error("Failed to locally exclusively activate %s.", + display_lvname(lvl->lv)); dm_list_uniterate(lvh, lvs, &lvl->list) { lvl = dm_list_item(lvh, struct lv_list); if (!deactivate_lv(cmd, lvl->lv)) diff --git a/tools/pvmove.c b/tools/pvmove.c index c5d7e52..af3fec4 100644 --- a/tools/pvmove.c +++ b/tools/pvmove.c @@ -375,9 +375,9 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd, continue; if (lv_is_converting(lv) || lv_is_merging(lv)) { - log_error("Unable to pvmove when %s volumes are present.", - lv_is_converting(lv) ? - "converting" : "merging"); + log_error("Unable to pvmove when %s volume %s is present.", + lv_is_converting(lv) ? "converting" : "merging", + display_lvname(lv)); return NULL; } @@ -389,13 +389,13 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd, return_NULL; /* - * Remove any PVs holding SubLV siblings to allow - * for collocation (e.g. *rmeta_0 -> *rimage_0). - * - * Callee checks for lv_name and valid raid segment type. - * - * FIXME: don't rely on namespace - */ + * Remove any PVs holding SubLV siblings to allow + * for collocation (e.g. *rmeta_0 -> *rimage_0). + * + * Callee checks for lv_name and valid raid segment type. + * + * FIXME: don't rely on namespace + */ if (!_remove_sibling_pvs_from_trim_list(lv, lv_name, &trim_list)) return_NULL; @@ -436,7 +436,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd, if (lv_is_locked(lv)) { lv_skipped = 1; - log_print_unless_silent("Skipping locked LV %s.", lv->name); + log_print_unless_silent("Skipping locked LV %s.", display_lvname(lv)); continue; } @@ -445,8 +445,9 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd, lv_is_active(lv) && !lv_is_active_exclusive_locally(lv)) { lv_skipped = 1; - log_print_unless_silent("Skipping LV %s which is activated " - "exclusively on remote node.", lv->name); + log_print_unless_silent("Skipping LV %s which is active, " + "but not locally exclusively.", + display_lvname(lv)); continue; } -- 1.8.3.1