]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/raid5: handle activation of replacement device when recovery completes.
authorNeilBrown <neilb@suse.de>
Fri, 9 Dec 2011 03:27:04 +0000 (14:27 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 9 Dec 2011 03:27:04 +0000 (14:27 +1100)
commitcded6c87778af20cb05421892ec6464a27526c11
tree622818c786e6adb407eb08819d85fc4777ce256f
parent15ff8c29c15f066f272dbafa0c9a83c1ef46f10b
md/raid5: handle activation of replacement device when recovery completes.

When recovery completes - as reported by a call to ->spare_active,
we clear In_sync on the original and set it on the replacement.

Then when the original gets removed we move the replacement from
'replacement' to 'rdev'.

This could race with other code that is looking at these pointers,
so we use memory barriers and careful ordering to ensure that
a reader might see one device twice, but never no devices.
Then the readers guard against using both devices, which could
only happen when writing.

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