diff options
author | NeilBrown <neilb@suse.de> | 2010-02-04 12:02:09 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-02-04 12:02:09 +1100 |
commit | 921d9e164fd3f6203d1b0cf2424b793043afd001 (patch) | |
tree | ad0fa1ec1343bd28676de6907177189ed14a748c /Assemble.c | |
parent | cc86f89c855fcfe9820d0621ede1575adc317155 (diff) | |
download | mdadm-921d9e164fd3f6203d1b0cf2424b793043afd001.tar.gz mdadm-921d9e164fd3f6203d1b0cf2424b793043afd001.tar.xz mdadm-921d9e164fd3f6203d1b0cf2424b793043afd001.zip |
Assemble: fix --force assembly of v1.x arrays which are recovering.
1.x metadata allows a device to be a member of the array while it
is still recoverying. So it is a working member, but is not
completely in-sync.
mdadm/assemble does not understand this distinction and assumes that a
work member is fully in-sync for the purpose of determining if there
are enough in-sync devices for the array to be functional.
So collect the 'recovery_start' value from the metadata and use it in
assemble when determining how useful a given device is.
Reported-by: Mikael Abrahamsson <swmike@swm.pp.se>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r-- | Assemble.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -800,7 +800,8 @@ int Assemble(struct supertype *st, char *mddev, if (devices[j].i.events+event_margin >= devices[most_recent].i.events) { devices[j].uptodate = 1; - if (i < content->array.raid_disks) { + if (i < content->array.raid_disks && + devices[j].i.recovery_start == MaxSector) { okcnt++; avail[i]=1; } else @@ -822,6 +823,7 @@ int Assemble(struct supertype *st, char *mddev, int j = best[i]; if (j>=0 && !devices[j].uptodate && + devices[j].i.recovery_start == MaxSector && (chosen_drive < 0 || devices[j].i.events > devices[chosen_drive].i.events)) |