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

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