]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: avoid a consistency check when --force is given.
authorNeilBrown <neilb@suse.de>
Mon, 8 Jul 2013 02:02:23 +0000 (12:02 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 8 Jul 2013 02:02:23 +0000 (12:02 +1000)
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>
Assemble.c

index 294c9926b98078484dab6b5713b647fd1f4f23b5..adc47866c1da33b1e4a0d3f223c9977564d67d44 100644 (file)
@@ -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) {