Blame SOURCES/0017-Mdmonitor-Improve-logging-method.patch

25786b
From f5ff2988761625b43eb15555993f2797af29f166 Mon Sep 17 00:00:00 2001
25786b
From: Kinga Tanska <kinga.tanska@intel.com>
25786b
Date: Mon, 6 Jun 2022 12:32:13 +0200
91179e
Subject: [PATCH 17/83] Mdmonitor: Improve logging method
25786b
25786b
Change logging, and as a result, mdmonitor in verbose
25786b
mode will report its configuration.
25786b
25786b
Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
25786b
Signed-off-by: Oleksandr Shchirskyi <oleksandr.shchirskyi@intel.com>
25786b
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
25786b
---
25786b
 Monitor.c | 25 ++++++++++++++-----------
25786b
 1 file changed, 14 insertions(+), 11 deletions(-)
25786b
25786b
diff --git a/Monitor.c b/Monitor.c
25786b
index 4e5802b5..6ca1ebe5 100644
25786b
--- a/Monitor.c
25786b
+++ b/Monitor.c
25786b
@@ -136,24 +136,27 @@ int Monitor(struct mddev_dev *devlist,
25786b
 	struct mddev_ident *mdlist;
25786b
 	int delay_for_event = c->delay;
25786b
 
25786b
-	if (!mailaddr) {
25786b
+	if (!mailaddr)
25786b
 		mailaddr = conf_get_mailaddr();
25786b
-		if (mailaddr && ! c->scan)
25786b
-			pr_err("Monitor using email address \"%s\" from config file\n",
25786b
-			       mailaddr);
25786b
-	}
25786b
-	mailfrom = conf_get_mailfrom();
25786b
 
25786b
-	if (!alert_cmd) {
25786b
+	if (!alert_cmd)
25786b
 		alert_cmd = conf_get_program();
25786b
-		if (alert_cmd && !c->scan)
25786b
-			pr_err("Monitor using program \"%s\" from config file\n",
25786b
-			       alert_cmd);
25786b
-	}
25786b
+
25786b
+	mailfrom = conf_get_mailfrom();
25786b
+
25786b
 	if (c->scan && !mailaddr && !alert_cmd && !dosyslog) {
25786b
 		pr_err("No mail address or alert command - not monitoring.\n");
25786b
 		return 1;
25786b
 	}
25786b
+
25786b
+	if (c->verbose) {
25786b
+		pr_err("Monitor is started with delay %ds\n", c->delay);
25786b
+		if (mailaddr)
25786b
+			pr_err("Monitor using email address %s\n", mailaddr);
25786b
+		if (alert_cmd)
25786b
+			pr_err("Monitor using program %s\n", alert_cmd);
25786b
+	}
25786b
+
25786b
 	info.alert_cmd = alert_cmd;
25786b
 	info.mailaddr = mailaddr;
25786b
 	info.mailfrom = mailfrom;
25786b
-- 
91179e
2.38.1
25786b