summaryrefslogtreecommitdiff
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-07-08 12:02:23 +1000
committerNeilBrown <neilb@suse.de>2013-07-08 12:02:23 +1000
commiteb20ecf101f0935b997e50ccf663e7eef4358d0e (patch)
treec21efdb8ece447b72ffac5f391c6659873e13304 /Assemble.c
parent8f0ac9d793ab61b842db0d370909f5b215c71d0f (diff)
Assemble: avoid a consistency check when --force is given.
mdadm will normally not include a device into an array if that device reports that the "best" device has failed, as this normally implies some sort of inconsistency. However when --force is given it means that the given drives really should be assembled if at all possible so in that case the test should be avoided. The particular case where this was a problem was a RAID5 were all devices had the same event count but three of them reported that the first two had failed. As they all had the same event count the first was taken as the 'best' and that caused the later ones to be excluded. Listing one of the later ones first allowed the array to be assembled. So in this case the test clearly just got in the way and did nothing useful. Reported-by: "Marek Jaros" <mjaros1@nbox.cz> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index 294c9926..adc47866 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1472,7 +1472,7 @@ try_again:
/* If this device thinks that 'most_recent' has failed, then
* we must reject this device.
*/
- if (j != most_recent &&
+ if (j != most_recent && !c->force &&
content->array.raid_disks > 0 &&
devices[most_recent].i.disk.raid_disk >= 0 &&
devmap[j * content->array.raid_disks + devices[most_recent].i.disk.raid_disk] == 0) {