mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 3 years ago
Clone

Blame SOURCES/lvm2-2_02_178-cleanup-enhance-messages.patch

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