]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: make sure metadata is updated when spares are activated or removed.
authorNeilBrown <neilb@suse.de>
Wed, 19 Sep 2012 02:54:22 +0000 (12:54 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:29:55 +0000 (10:29 -0700)
commitd765682ea82fb83fd8d01b7663f78b5d2f9fd839
tree9fa4d0763768e38d8538a713202378df00f7dc51
parent1c55a12c2a3d5b54598e7ba04e2d0fcf858b9023
md: make sure metadata is updated when spares are activated or removed.

commit 6dafab6b1383e912cd252fa809570b484eb6e0dc upstream.

It isn't always necessary to update the metadata when spares are
removed as the presence-or-not of a spare isn't really important to
the integrity of an array.
Also activating a spare doesn't always require updating the metadata
as the update on 'recovery-completed' is usually sufficient.

However the introduction of 'replacement' devices have made these
transitions sometimes more important.  For example the 'Replacement'
flag isn't cleared until the original device is removed, so we need
to ensure a metadata update after that 'spare' is removed.

So set MD_CHANGE_DEVS whenever a spare is activated or removed, to
complement the current situation where it is set when a spare is added
or a device is failed (or a number of other less common situations).

This is suitable for -stable as out-of-data metadata could lead
to data corruption.
This is only relevant for 3.3 and later 9when 'replacement' as
introduced.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/md.c