]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/raid5: handle activation of replacement device when recovery completes.
authorNeilBrown <neilb@suse.de>
Wed, 9 Nov 2011 00:32:08 +0000 (11:32 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 9 Nov 2011 00:32:08 +0000 (11:32 +1100)
commit123b18432f3f87c0794c0b9aa3f9adfdd5dbc06b
tree770895effa73dae62b57a3a8659f9b1a098dece9
parent2832c6102d7c5f886c93725d0f9c52ba43a97643
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