]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Default to --auto=yes
authorNeil Brown <neilb@suse.de>
Thu, 14 Dec 2006 06:31:10 +0000 (17:31 +1100)
committerNeil Brown <neilb@suse.de>
Thu, 14 Dec 2006 06:31:10 +0000 (17:31 +1100)
so the array devices with 'standard' names
get created automatically, as this is almost always what is wanted.

ChangeLog
config.c
mdadm.8
mdopen.c

index 1c359f85a284f4f54174ae323429cb2321db3253..46af0ee1a91b76d13586daa92a8483d2d1117d7c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@ Changes Prior to this release
        missing devices.
     -   Support --update=devicesize for cases where the underlying device
        can change size.
        missing devices.
     -   Support --update=devicesize for cases where the underlying device
        can change size.
+    -   Default to --auto=yes so the array devices with 'standard' names
+       get created automatically, as this is almost always what is wanted.
 
 Changes Prior to 2.5.6 release
     -   Fix bug which meant "bitmap=xxx" in mdadm.conf was not handled
 
 Changes Prior to 2.5.6 release
     -   Fix bug which meant "bitmap=xxx" in mdadm.conf was not handled
index 38e911acdd218db6dc3182f3926baabb94214d8c..7101c3b0f14a4b29e112310e05b21cada9689978 100644 (file)
--- a/config.c
+++ b/config.c
@@ -255,6 +255,7 @@ mddev_dev_t load_partitions(void)
 }
 
 struct createinfo createinfo = {
 }
 
 struct createinfo createinfo = {
+       .autof = 2, /* by default, create devices with standard names */
        .symlinks = 1,
 #ifdef DEBIAN
        .gid = 6, /* disk */
        .symlinks = 1,
 #ifdef DEBIAN
        .gid = 6, /* disk */
diff --git a/mdadm.8 b/mdadm.8
index f761853c16ec5f6d91aa9f39cef8f7479a21f4cd..274609c17180676c953473413faa455b9fb23815 100644 (file)
--- a/mdadm.8
+++ b/mdadm.8
@@ -573,6 +573,10 @@ from this.  See DEVICE NAMES below.
 The argument can also come immediately after
 "-a".  e.g. "-ap".
 
 The argument can also come immediately after
 "-a".  e.g. "-ap".
 
+If --auto is not given on the command line or in the config file, then
+the default will be
+.BR --auto=yes .
+
 If
 .I --scan
 is also given, then any
 If
 .I --scan
 is also given, then any
@@ -1060,13 +1064,11 @@ may work for RAID1, 4, 5, 6, or 10), give the
 .B --run
 flag.
 
 .B --run
 flag.
 
-If an
-.B auto
-option is given, either on the command line (--auto) or in the
-configuration file (e.g. auto=part), then
-.I mdadm
-will create the md device if necessary or will re-create it if it
-doesn't look usable as it is.
+If the md device does not exist, then it will be created providing the
+intent is clear. i.e. the name must be in a standard form, or the
+.I --auto
+option must be given to clarify how and whether the device should be
+created.
 
 This can be useful for handling partitioned devices (which don't have
 a stable device number - it can change after a reboot) and when using
 
 This can be useful for handling partitioned devices (which don't have
 a stable device number - it can change after a reboot) and when using
index ce3a12e8c2fff377a83a073a0884ef884044b77a..9f3dfb8465ec31a10b72e8816ea7c93ef7b81321 100644 (file)
--- a/mdopen.c
+++ b/mdopen.c
@@ -135,10 +135,6 @@ int open_mddev(char *dev, int autof)
                                dev);
                        return -1;
                }
                                dev);
                        return -1;
                }
-               if (autof == 2 && stb.st_mode == 0 && !is_standard(dev, NULL)) {
-                       fprintf(stderr, Name ": --auto=yes requires a 'standard' md device name, not %s\n", dev);
-                       return -1;
-               }
                /* check major number is correct */
                num = -1;
                std = is_standard(dev, &num);
                /* check major number is correct */
                num = -1;
                std = is_standard(dev, &num);
@@ -146,19 +142,23 @@ int open_mddev(char *dev, int autof)
                switch(autof) {
                case 2: /* only create is_standard names */
                        if (!std && !stb.st_mode) {
                switch(autof) {
                case 2: /* only create is_standard names */
                        if (!std && !stb.st_mode) {
-                               fprintf(stderr, Name ": --auto=yes requires a 'standard' md device name, not %s\n", dev);
+                               fprintf(stderr, Name
+                       ": %s does not exist and is not a 'standard' name "
+                       "so it cannot be created\n", dev);
                                return -1;
                        }
                        break;
                case 3: /* create md, reject std>0 */
                        if (std > 0) {
                                return -1;
                        }
                        break;
                case 3: /* create md, reject std>0 */
                        if (std > 0) {
-                               fprintf(stderr, Name ": that --auto option not compatable with device named %s\n", dev);
+                               fprintf(stderr, Name ": that --auto option "
+                               "not compatable with device named %s\n", dev);
                                return -1;
                        }
                        break;
                case 4: /* create mdp, reject std<0 */
                        if (std < 0) {
                                return -1;
                        }
                        break;
                case 4: /* create mdp, reject std<0 */
                        if (std < 0) {
-                               fprintf(stderr, Name ": that --auto option not compatable with device named %s\n", dev);
+                               fprintf(stderr, Name ": that --auto option "
+                               "not compatable with device named %s\n", dev);
                                return -1;
                        }
                        break;
                                return -1;
                        }
                        break;