]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Monitor.c
Monitor: block if monitor modes are combined.
[thirdparty/mdadm.git] / Monitor.c
index 0036e8cd0f18749159ee140d3244890ef19e94da..188cb8be0e2a8fe695b77254af936483afba13ae 100644 (file)
--- 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();