summaryrefslogtreecommitdiff
path: root/Incremental.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 19:35:25 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 19:35:25 +1100
commita5d85af748aafe3e3830b9d16faa5c92e783b171 (patch)
tree226da96fa25afdd3bc97ead7e91b5e59b10a8e8f /Incremental.c
parentf94c116f56cb821bfd619481d94fcd78ab8b53c0 (diff)
get_info_super: report which other devices are thought to be working/failed.
To accurately detect when an array has been split and is now being recombined, we need to track which other devices each thinks is working. We should never include a device in an array if it thinks that the primary device has failed. This patch just allows get_info_super to return a list of devices and whether they are thought to be working or not. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Incremental.c b/Incremental.c
index a60be47a..23f59800 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -156,7 +156,7 @@ int Incremental(char *devname, int verbose, int runstop,
close (dfd); dfd = -1;
memset(&info, 0, sizeof(info));
- st->ss->getinfo_super(st, &info);
+ st->ss->getinfo_super(st, &info, NULL);
/* 3/ Check if there is a match in mdadm.conf */
array_list = conf_get_ident(NULL);
@@ -433,7 +433,7 @@ int Incremental(char *devname, int verbose, int runstop,
}
close(dfd2);
memset(&info2, 0, sizeof(info2));
- st2->ss->getinfo_super(st2, &info2);
+ st2->ss->getinfo_super(st2, &info2, NULL);
st2->ss->free_super(st2);
if (info.array.level != info2.array.level ||
memcmp(info.uuid, info2.uuid, 16) != 0 ||
@@ -623,7 +623,7 @@ static void find_reject(int mdfd, struct supertype *st, struct mdinfo *sra,
close(dfd);
continue;
}
- st->ss->getinfo_super(st, &info);
+ st->ss->getinfo_super(st, &info, NULL);
st->ss->free_super(st);
close(dfd);
@@ -668,7 +668,7 @@ static int count_active(struct supertype *st, int mdfd, char **availp,
close(dfd);
if (ok != 0)
continue;
- st->ss->getinfo_super(st, &info);
+ st->ss->getinfo_super(st, &info, NULL);
if (!avail) {
avail = malloc(info.array.raid_disks);
if (!avail) {
@@ -685,7 +685,7 @@ static int count_active(struct supertype *st, int mdfd, char **availp,
cnt++;
max_events = info.events;
avail[info.disk.raid_disk] = 2;
- st->ss->getinfo_super(st, bestinfo);
+ st->ss->getinfo_super(st, bestinfo, NULL);
} else if (info.events == max_events) {
cnt++;
avail[info.disk.raid_disk] = 2;
@@ -703,12 +703,12 @@ static int count_active(struct supertype *st, int mdfd, char **availp,
if (avail[i])
avail[i]--;
avail[info.disk.raid_disk] = 2;
- st->ss->getinfo_super(st, bestinfo);
+ st->ss->getinfo_super(st, bestinfo, NULL);
} else { /* info.events much bigger */
cnt = 1; cnt1 = 0;
memset(avail, 0, info.disk.raid_disk);
max_events = info.events;
- st->ss->getinfo_super(st, bestinfo);
+ st->ss->getinfo_super(st, bestinfo, NULL);
}
}
st->ss->free_super(st);
@@ -944,7 +944,7 @@ static int partition_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
goto next;
}
- st2->ss->getinfo_super(st2, &info);
+ st2->ss->getinfo_super(st2, &info, NULL);
if (info.component_size > devsectors)
/* This partitioning doesn't fit in the device */
goto next;