]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
md: Fix raid10 recovery problem.
authorNeilBrown <neilb@suse.de>
Tue, 20 Feb 2007 06:34:47 +0000 (17:34 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Mar 2007 18:50:23 +0000 (10:50 -0800)
commit745bc0b7b058e6d420aeed5eb7c37a0e1670c8f2
tree5f8a529da84f48a77f5842d7dff37490c17f44ec
parent810189f708eaa80cddf9e1318e98bf48af1c9361
md: Fix raid10 recovery problem.

There are two errors that can lead to recovery problems with raid10
when used in 'far' more (not the default).

Due to a '>' instead of '>=' the wrong block is located which would
result in garbage being written to some random location, quite
possible outside the range of the device, causing the newly
reconstructed device to fail.

The device size calculation had some rounding errors (it didn't round
when it should) and so recovery would go a few blocks too far which
would again cause a write to a random block address and probably
a device error.

The code for working with device sizes was fairly confused and spread
out, so this has been tided up a bit.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/raid10.c