Blame SOURCES/0063-Monitor-block-if-monitor-modes-are-combined.patch

2ad819
From f40ac0e7e6043361ad12e9db97c07e56c3977cf6 Mon Sep 17 00:00:00 2001
2ad819
From: Blazej Kucman <blazej.kucman@intel.com>
2ad819
Date: Mon, 19 Dec 2022 11:21:57 +0100
2ad819
Subject: [PATCH 63/83] Monitor: block if monitor modes are combined.
2ad819
2ad819
Block monitoring start if --scan mode and MD devices list are combined.
2ad819
2ad819
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
2ad819
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2ad819
---
2ad819
 Monitor.c | 7 ++++++-
2ad819
 1 file changed, 6 insertions(+), 1 deletion(-)
2ad819
2ad819
diff --git a/Monitor.c b/Monitor.c
2ad819
index 0036e8cd..188cb8be 100644
2ad819
--- a/Monitor.c
2ad819
+++ b/Monitor.c
2ad819
@@ -123,7 +123,7 @@ int Monitor(struct mddev_dev *devlist,
2ad819
 	 *  and if we can get_disk_info and find a name
2ad819
 	 *  Then we hot-remove and hot-add to the other array
2ad819
 	 *
2ad819
-	 * If devlist is NULL, then we can monitor everything because --scan
2ad819
+	 * If devlist is NULL, then we can monitor everything if --scan
2ad819
 	 * was given.  We get an initial list from config file and add anything
2ad819
 	 * that appears in /proc/mdstat
2ad819
 	 */
2ad819
@@ -136,6 +136,11 @@ int Monitor(struct mddev_dev *devlist,
2ad819
 	struct mddev_ident *mdlist;
2ad819
 	int delay_for_event = c->delay;
2ad819
 
2ad819
+	if (devlist && c->scan) {
2ad819
+		pr_err("Devices list and --scan option cannot be combined - not monitoring.\n");
2ad819
+		return 1;
2ad819
+	}
2ad819
+
2ad819
 	if (!mailaddr)
2ad819
 		mailaddr = conf_get_mailaddr();
2ad819
 
2ad819
-- 
2ad819
2.38.1
2ad819