[dm-devel] [PATCH v2 8/8] multipathd: log reason for calling domap()

Benjamin Marzinski bmarzins at redhat.com
Tue Aug 11 21:58:43 UTC 2020


When multipathd calls domap(), it should also print the reason on log
level 2, it already does this on every code path except when domap is
called by the path_checker.  Also, if __setup_multipath deletes the
device, it should log that.

Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
 multipathd/main.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 2b0e2734..ee44d0fe 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -414,7 +414,7 @@ int __setup_multipath(struct vectors *vecs, struct multipath *mpp,
 {
 	if (dm_get_info(mpp->alias, &mpp->dmi)) {
 		/* Error accessing table */
-		condlog(3, "%s: cannot access table", mpp->alias);
+		condlog(2, "%s: cannot access table", mpp->alias);
 		goto out;
 	}
 
@@ -2252,13 +2252,18 @@ check_path (struct vectors * vecs, struct path * pp, unsigned int ticks)
 	 */
 	condlog(4, "path prio refresh");
 
-	if (marginal_changed)
+	if (marginal_changed) {
+		condlog(2, "%s: path is %s marginal", pp->dev,
+			(pp->marginal)? "now" : "no longer");
 		update_path_groups(pp->mpp, vecs, 1);
+	}
 	else if (update_prio(pp, new_path_up) &&
 	    (pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio) &&
-	     pp->mpp->pgfailback == -FAILBACK_IMMEDIATE)
+	     pp->mpp->pgfailback == -FAILBACK_IMMEDIATE) {
+		condlog(2, "%s: path priorities changed. reloading",
+			pp->mpp->alias);
 		update_path_groups(pp->mpp, vecs, !new_path_up);
-	else if (need_switch_pathgroup(pp->mpp, 0)) {
+	} else if (need_switch_pathgroup(pp->mpp, 0)) {
 		if (pp->mpp->pgfailback > 0 &&
 		    (new_path_up || pp->mpp->failback_tick <= 0))
 			pp->mpp->failback_tick =
-- 
2.17.2




More information about the dm-devel mailing list