Thread (2 messages) 2 messages, 2 authors, 2021-05-06

[PATCH] Prevent user from using --stop with ambiguous args

flat view
STALE1981d

From: Mariusz Tkaczyk <hidden>
Date: 2021-05-05 11:01:23
Subsystem: the rest · Maintainer: Linus Torvalds

From: Norbert Szulc <redacted>

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 <redacted>
Signed-off-by: Mariusz Tkaczyk <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help