md/raid10: Don't skip more than 1 bitmap-chunk at a time during recovery.
authorNeilBrown <neilb@suse.de>
Wed, 25 Feb 2009 02:18:47 +0000 (13:18 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Mar 2009 00:32:09 +0000 (17:32 -0700)
commit6bd24b2f85a3290c1b68f7a9185bd87bf506a441
treec925ea5347b25efa09b84accb0d8e2070f4a1459
parent17872fe9e5c0e854598e92aa5861edae61ef8fdf
md/raid10: Don't skip more than 1 bitmap-chunk at a time during recovery.

commit 09b4068a7fe442efc40e9dcbcf5ff37c3338ab15 upstream.

When doing recovery on a raid10 with a write-intent bitmap, we only
need to recovery chunks that are flagged in the bitmap.

However if we choose to skip a chunk as it isn't flag, the code
currently skips the whole raid10-chunk, thus it might not recovery
some blocks that need recovering.

This patch fixes it.

In case that is confusing, it might help to understand that there
is a 'raid10 chunk size' which guides how data is distributed across
the devices, and a 'bitmap chunk size' which says how much data
corresponds to a single bit in the bitmap.

This bug only affects cases where the bitmap chunk size is smaller
than the raid10 chunk size.

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