From: Neil Brown Date: Wed, 8 Jun 2005 01:16:31 +0000 (+0000) Subject: Allow --auto to still be meaningful when --scan is given X-Git-Tag: mdadm-1.12.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a68aa90e8ce7a8fc713030fe6ed64cc049f5f6ac;p=thirdparty%2Fmdadm.git Allow --auto to still be meaningful when --scan is given Signed-off-by: Neil Brown --- diff --git a/ChangeLog b/ChangeLog index 5df8533a..dfa5f30d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ Changes Prior to 1.12.0 release so that stack devices are stopped properly - Minor type rationalisation for ident->uuid - now always 'int[]' - Fix type in online help for --grow (was -F, now -G) + - Allow --auto command line option to set default auto= + value when running "--assemble --scan". Previously + --auto was ignored if --scan was given Changes Prior to 1.11.0 release - Fix embarassing bug which causes --add to always fail. diff --git a/config.c b/config.c index 6c228898..0fa32511 100644 --- a/config.c +++ b/config.c @@ -336,7 +336,7 @@ void arrayline(char *line) else if (strcasecmp(w+5,"yes")==0 || strcasecmp(w+5,"md")==0) mis.autof = -1; else { - /* There might be digits, and maybe a hypen, at the end */ + /* There might be digits, and maybe a hyphen, at the end */ char *e = w+5 + strlen(w+5); int num = 4; int len; diff --git a/mdadm.8 b/mdadm.8 index bbe50b24..13e1bfa5 100644 --- a/mdadm.8 +++ b/mdadm.8 @@ -391,6 +391,14 @@ from this. See DEVICE NAMES below. The argumentment can also come immediately after "-a". e.g. "-ap". +If +.I --scan +is also given, then any +.I auto= +entries in the config file will over-ride the +.I --auto +instruction given on the command line. + For partitionable arrays, .I mdadm will create the device file for the whole array and for the first 4 diff --git a/mdadm.c b/mdadm.c index 57fd3cdc..19ca9986 100644 --- a/mdadm.c +++ b/mdadm.c @@ -732,7 +732,8 @@ int main(int argc, char *argv[]) devlist->devname); rv |= 1; } else { - mdfd = open_mddev(devlist->devname, array_ident->autof); + mdfd = open_mddev(devlist->devname, + array_ident->autof ? array_ident->autof : autof); if (mdfd < 0) rv |= 1; else { @@ -759,7 +760,8 @@ int main(int argc, char *argv[]) rv |= 1; continue; } - mdfd = open_mddev(dv->devname, array_ident->autof); + mdfd = open_mddev(dv->devname, + array_ident->autof ?array_ident->autof : autof); if (mdfd < 0) { rv |= 1; continue; @@ -777,7 +779,8 @@ int main(int argc, char *argv[]) } else for (; array_list; array_list = array_list->next) { mdu_array_info_t array; - mdfd = open_mddev(array_list->devname, array_list->autof); + mdfd = open_mddev(array_list->devname, + array_list->autof ? array_list->autof : autof); if (mdfd < 0) { rv |= 1; continue;