Thread (6 messages) 6 messages, 2 authors, 2022-12-19
STALE1313d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 1/2] Monitor: block if monitor modes are combined.

From: Blazej Kucman <hidden>
Date: 2022-12-19 09:59:17
Subsystem: the rest · Maintainer: Linus Torvalds

Block monitoring start if --scan mode and MD devices list are combined.

Signed-off-by: Blazej Kucman <redacted>
Change-Id: Ic2b90662dbd297e8e2c8e88194155d65110ef517
---
 Monitor.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Monitor.c b/Monitor.c
index 7d7dc4d2..119e17d8 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -123,7 +123,7 @@ int Monitor(struct mddev_dev *devlist,
 	 *  and if we can get_disk_info and find a name
 	 *  Then we hot-remove and hot-add to the other array
 	 *
-	 * If devlist is NULL, then we can monitor everything because --scan
+	 * If devlist is NULL, then we can monitor everything if --scan
 	 * was given.  We get an initial list from config file and add anything
 	 * that appears in /proc/mdstat
 	 */
@@ -136,6 +136,11 @@ int Monitor(struct mddev_dev *devlist,
 	struct mddev_ident *mdlist;
 	int delay_for_event = c->delay;
 
+	if (devlist && c->scan) {
+		pr_err("Devices list and --scan option cannot be combined - not monitoring.\n");
+		return 1;
+	}
+
 	if (!mailaddr)
 		mailaddr = conf_get_mailaddr();
 
-- 
2.35.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help