All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Prevent user from using --stop with ambiguous args
@ 2021-05-05 11:01 Mariusz Tkaczyk
  2021-05-06 21:09 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Mariusz Tkaczyk @ 2021-05-05 11:01 UTC (permalink / raw)
  To: jes; +Cc: linux-raid

From: Norbert Szulc <norbert.szulc@intel.com>

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>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Prevent user from using --stop with ambiguous args
  2021-05-05 11:01 [PATCH] Prevent user from using --stop with ambiguous args Mariusz Tkaczyk
@ 2021-05-06 21:09 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2021-05-06 21:09 UTC (permalink / raw)
  To: Mariusz Tkaczyk; +Cc: linux-raid

On 5/5/21 7:01 AM, Mariusz Tkaczyk wrote:
> From: Norbert Szulc <norbert.szulc@intel.com>
> 
> 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>
> ---
>  mdadm.c | 5 +++++
>  1 file changed, 5 insertions(+)

Applied!

Thanks,
Jes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-06 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 11:01 [PATCH] Prevent user from using --stop with ambiguous args Mariusz Tkaczyk
2021-05-06 21:09 ` Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.