Message ID | 20221219095835.686-2-blazej.kucman@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | Changes in Monitor | expand |
> 2022年12月19日 17:58,Blazej Kucman <blazej.kucman@intel.com> 写道: > > Block monitoring start if --scan mode and MD devices list are combined. > > Signed-off-by: Blazej Kucman <blazej.kucman@intel.com> > Change-Id: Ic2b90662dbd297e8e2c8e88194155d65110ef517 I guess Change-ID is unnecessary for mdadm upstream? Otherwise, it is fine to me, Acked-by: Coly Li <colyli@suse.de <mailto:colyli@suse.de>> Thanks. Coly Li > --- > 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 >
> 2022年12月19日 17:58,Blazej Kucman <blazej.kucman@intel.com> 写道: > > Block monitoring start if --scan mode and MD devices list are combined. > > Signed-off-by: Blazej Kucman <blazej.kucman@intel.com> > Change-Id: Ic2b90662dbd297e8e2c8e88194155d65110ef517 I guess Change-ID is unnecessary for mdadm upstream? Otherwise, it is fine to me, Acked-by: Coly Li <colyli@suse.de> Thanks. Coly Li > --- > 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 >
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();
Block monitoring start if --scan mode and MD devices list are combined. Signed-off-by: Blazej Kucman <blazej.kucman@intel.com> Change-Id: Ic2b90662dbd297e8e2c8e88194155d65110ef517 --- Monitor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)