md/raid5: prefer replacing failed devices over want-replacement devices.
authorNeilBrown <neilb@suse.de>
Tue, 3 Jul 2012 01:46:53 +0000 (11:46 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 3 Jul 2012 01:46:53 +0000 (11:46 +1000)
If a RAID5 has both a failed device and a device marked as
'WantReplacement', then we should preferentially replace the failed
device.
However the current code replaces whichever is found first.
So split into 2 loops, check fail failed/missing first, and only check
for WantReplacement if nothing is failed or missing.

Reported-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>

No differences found