summaryrefslogtreecommitdiffstats
path: root/mdopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdopen.c')
-rw-r--r--mdopen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mdopen.c b/mdopen.c
index 1ba5201..98c6fdb 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -92,6 +92,10 @@ int open_mddev(char *dev, int autof)
/* autof is set, so we need to check that the name is ok,
* and possibly create one if not
*/
+ if (autof == -2 && !is_standard(dev, NULL)) {
+ fprintf(stderr, Name ": --auto=yes requires a 'standard' md device name, not %s\n", dev);
+ return -1;
+ }
stb.st_mode = 0;
if (lstat(dev, &stb)==0 && ! S_ISBLK(stb.st_mode)) {
fprintf(stderr, Name ": %s is not a block device.\n",