From fbf8a0b7a6f107c0fcecb6fea5640ffb1bc0d9c2 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 18 Jul 2005 01:30:42 +0000 Subject: Document this... Signed-off-by: Neil Brown --- Assemble.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Assemble.c') 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; -- cgit