md: Don't use remove_and_add_spares to remove failed devices from a read-only array
authorNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 02:47:13 +0000 (13:47 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 02:47:13 +0000 (13:47 +1100)
commita8c42c7f476b5bb39bb3a5b32d5473b9a46cadb9
tree59b82042476e6b92ee293570d30a2580dba56d09
parentfc3a08b85b7a4f6c1069e5f71f6ad40d925ff55b
md: Don't use remove_and_add_spares to remove failed devices from a read-only array

remove_and_add_spares is called in two places where the needs really
are very different.
remove_and_add_spares should not be called on an array which is about
to be reshaped as some extra devices might have been manually added
and that would remove them.  However if the array is 'read-auto',
that will currently happen, which is bad.

So in the 'ro != 0' case don't call remove_and_add_spares but simply
remove the failed devices as the comment suggests is needed.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c