From: Norbert Szulc <norbert.szulc@xxxxxxxxx> When both --scan and device name is passed to --stop action, then is executed only for given device. Scan is ignored. Block the operation when both --scan and device name are passed. Signed-off-by: Norbert Szulc <norbert.szulc@xxxxxxxxx> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@xxxxxxxxxxxxxxx> --- mdadm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mdadm.c b/mdadm.c index 493d70e4..9f5f7934 100644 --- a/mdadm.c +++ b/mdadm.c @@ -2039,6 +2039,11 @@ static int misc_list(struct mddev_dev *devlist, rv |= Manage_run(dv->devname, mdfd, c); break; case 'S': + if (c->scan) { + pr_err("--stop not meaningful with both a --scan assembly and a device name.\n"); + rv |= 1; + break; + } rv |= Manage_stop(dv->devname, mdfd, c->verbose, 0); break; case 'o': -- 2.26.2