]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/raid5: detect and handle replacements during recovery.
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)
commit15ff8c29c15f066f272dbafa0c9a83c1ef46f10b
tree84a0db502e938d50cba049b5eaec8a2348fbd051
parent6dd28c71929675d7a4b08d07900078f6a3ece9ad
md/raid5:  detect and handle replacements during recovery.

During recovery we want to write to the replacement but not
the original.  So we have two new flags
 - R5_NeedReplace if this stripe has a replacement that needs to
   be written at some stage
 - R5_WantReplace if NeedReplace, and the data is available, and
   a 'sync' has been requested on this stripe.

We also distinguish between 'sync and replace' which need to read
all other devices, and 'replace' which only needs to read the
devices being replaced.

Note that during resync we always write to any replacement device.
It might not need to be written to, but as we don't read to compare,
we have to write to be sure.

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