Allow --auto to still be meaningful when --scan is given

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
This commit is contained in:
Neil Brown 2005-06-14 06:33:02 +00:00
parent 92919398cc
commit 1337546dc1
4 changed files with 18 additions and 4 deletions

View File

@ -6,6 +6,9 @@ Changes Prior to this release
so that stack devices are stopped properly so that stack devices are stopped properly
- Minor type rationalisation for ident->uuid - now always 'int[]' - Minor type rationalisation for ident->uuid - now always 'int[]'
- Fix type in online help for --grow (was -F, now -G) - 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 Changes Prior to 1.11.0 release
- Fix embarassing bug which causes --add to always fail. - Fix embarassing bug which causes --add to always fail.

View File

@ -345,7 +345,7 @@ void arrayline(char *line)
else if (strcasecmp(w+5,"yes")==0 || strcasecmp(w+5,"md")==0) else if (strcasecmp(w+5,"yes")==0 || strcasecmp(w+5,"md")==0)
mis.autof = -1; mis.autof = -1;
else { 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); char *e = w+5 + strlen(w+5);
int num = 4; int num = 4;
int len; int len;

View File

@ -435,6 +435,14 @@ from this. See DEVICE NAMES below.
The argumentment can also come immediately after The argumentment can also come immediately after
"-a". e.g. "-ap". "-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, For partitionable arrays,
.I mdadm .I mdadm
will create the device file for the whole array and for the first 4 will create the device file for the whole array and for the first 4

View File

@ -821,7 +821,8 @@ int main(int argc, char *argv[])
devlist->devname); devlist->devname);
rv |= 1; rv |= 1;
} else { } else {
mdfd = open_mddev(devlist->devname, array_ident->autof); mdfd = open_mddev(devlist->devname,
array_ident->autof ? array_ident->autof : autof);
if (mdfd < 0) if (mdfd < 0)
rv |= 1; rv |= 1;
else { else {
@ -848,7 +849,8 @@ int main(int argc, char *argv[])
rv |= 1; rv |= 1;
continue; continue;
} }
mdfd = open_mddev(dv->devname, array_ident->autof); mdfd = open_mddev(dv->devname,
array_ident->autof ?array_ident->autof : autof);
if (mdfd < 0) { if (mdfd < 0) {
rv |= 1; rv |= 1;
continue; continue;
@ -866,7 +868,8 @@ int main(int argc, char *argv[])
} else } else
for (; array_list; array_list = array_list->next) { for (; array_list; array_list = array_list->next) {
mdu_array_info_t array; 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) { if (mdfd < 0) {
rv |= 1; rv |= 1;
continue; continue;