diff options
author | Norbert Szulc <norbert.szulc@intel.com> | 2021-05-05 13:01:02 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2021-05-06 23:01:25 +0200 |
commit | 0530e2e0d8c9ecb5171e70bc48e1a6566f317378 (patch) | |
tree | 9512ac499faa4dce8b16cf2c25f38d28f74a692a /mdadm.c | |
parent | Fix some building errors (diff) | |
download | mdadm-0530e2e0d8c9ecb5171e70bc48e1a6566f317378.tar.xz mdadm-0530e2e0d8c9ecb5171e70bc48e1a6566f317378.zip |
Prevent user from using --stop with ambiguous args
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@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -2041,6 +2041,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': |