summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-07-18 01:30:42 +0000
committerNeil Brown <neilb@suse.de>2005-07-18 01:30:42 +0000
commitfbf8a0b7a6f107c0fcecb6fea5640ffb1bc0d9c2 (patch)
tree6de8349d9242cfe11ad7ea0c3ac394a530315cf6 /Assemble.c
parentbea93430e8b9327688fa9f6d5220d9250546a292 (diff)
downloadmdadm-fbf8a0b7a6f107c0fcecb6fea5640ffb1bc0d9c2.tar.gz
mdadm-fbf8a0b7a6f107c0fcecb6fea5640ffb1bc0d9c2.tar.xz
mdadm-fbf8a0b7a6f107c0fcecb6fea5640ffb1bc0d9c2.zip
Document this...
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index 5bf58ab..89086e3 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -473,6 +473,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
if (!devices[j].uptodate)
continue;
info.disk.number = i;
+ info.disk.raid_disk = i;
info.disk.state = desired_state;
if (devices[j].uptodate &&
@@ -526,7 +527,17 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
/* Almost ready to actually *do* something */
if (!old_linux) {
- if (ioctl(mdfd, SET_ARRAY_INFO, NULL) != 0) {
+ int rv;
+ if ((vers % 100) >= 1) { /* can use different versions */
+ mdu_array_info_t inf;
+ memset(&inf, 0, sizeof(inf));
+ inf.major_version = st->ss->major;
+ inf.minor_version = st->minor_version;
+ rv = ioctl(mdfd, SET_ARRAY_INFO, &inf);
+ } else
+ rv = ioctl(mdfd, SET_ARRAY_INFO, NULL);
+
+ if (rv) {
fprintf(stderr, Name ": SET_ARRAY_INFO failed for %s: %s\n",
mddev, strerror(errno));
return 1;