]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md/raid1: don't abort a resync on the first badblock.
authorNeilBrown <neilb@suse.de>
Tue, 31 Jul 2012 00:05:34 +0000 (10:05 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2012 14:52:46 +0000 (07:52 -0700)
commit8f605e2a8b7910bfe810c05d25c7d6a45b708dc7
treef69cb4f12050ca0057a66982887c091205f0a5ad
parent10c3d285453e077745a0d8a581201fc485712f82
md/raid1: don't abort a resync on the first badblock.

commit b7219ccb33aa0df9949a60c68b5e9f712615e56f upstream.

If a resync of a RAID1 array with 2 devices finds a known bad block
one device it will neither read from, or write to, that device for
this block offset.
So there will be one read_target (The other device) and zero write
targets.
This condition causes md/raid1 to abort the resync assuming that it
has finished - without known bad blocks this would be true.

When there are no write targets because of the presence of bad blocks
we should only skip over the area covered by the bad block.
RAID10 already gets this right, raid1 doesn't.  Or didn't.

As this can cause a 'sync' to abort early and appear to have succeeded
it could lead to some data corruption, so it suitable for -stable.

Reported-by: Alexander Lyakas <alex.bolshoy@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid1.c