summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-08-09 05:23:20 +0000
committerNeil Brown <neilb@suse.de>2005-08-09 05:23:20 +0000
commit947fd4ddb554fd2c3d81c190dfe63407f8771eb8 (patch)
tree10b16db86578ca184faabae4232a886d2cff1ddc /Assemble.c
parentdfd4d8ee426fb71a369f494f95fe95b114a33c7c (diff)
downloadmdadm-947fd4ddb554fd2c3d81c190dfe63407f8771eb8.tar.gz
mdadm-947fd4ddb554fd2c3d81c190dfe63407f8771eb8.tar.xz
mdadm-947fd4ddb554fd2c3d81c190dfe63407f8771eb8.zip
Support nameing of version-1 arrays.
--name is recognised in --create and --assemble name= is recognised in config file. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/Assemble.c b/Assemble.c
index 739db51..449073f 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -116,6 +116,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
unsigned int num_devs;
mddev_dev_t tmpdev;
struct mdinfo info;
+ struct mddev_ident_s ident2;
vers = md_get_version(mdfd);
if (vers <= 0) {
@@ -214,7 +215,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
devname);
close(dfd);
} else {
- tst->ss->getinfo_super(&info, super);
+ tst->ss->getinfo_super(&info, &ident2, super);
close(dfd);
}
@@ -225,6 +226,13 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
devname);
continue;
}
+ if (ident->name[0] &&
+ (!super || strncmp(ident2.name, ident->name, 32)!=0)) {
+ if (inargv || verbose)
+ fprintf(stderr, Name ": %s has wrong name.\n",
+ devname);
+ continue;
+ }
if (ident->super_minor != UnSet &&
(!super || ident->super_minor != info.array.md_minor)) {
if (inargv || verbose)
@@ -344,7 +352,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
return 1;
}
- st->ss->getinfo_super(&info, first_super);
+ st->ss->getinfo_super(&info, &ident2, first_super);
/* now we have some devices that might be suitable.
* I wonder how many
@@ -461,7 +469,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
fprintf(stderr, Name ": No suitable drives found for %s\n", mddev);
return 1;
}
- st->ss->getinfo_super(&info, super);
+ st->ss->getinfo_super(&info, &ident2, super);
for (i=0; i<bestcnt; i++) {
int j = best[i];
unsigned int desired_state;