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

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