aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-02-24 21:18:47 -0500
committerNeilBrown <neilb@suse.de>2009-02-24 21:18:47 -0500
commit09b4068a7fe442efc40e9dcbcf5ff37c3338ab15 (patch)
treec7d2eb0715e2b12cac4bc2196583a510c234743c /drivers/md/raid10.c
parent2ec77fc93ca8731368fbe8e71f805c0569d4bcee (diff)
md/raid10: Don't skip more than 1 bitmap-chunk at a time during recovery.
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. Cc: stable@kernel.org Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 6736d6dff98..118f89e716e 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2010,13 +2010,13 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
2010 /* There is nowhere to write, so all non-sync 2010 /* There is nowhere to write, so all non-sync
2011 * drives must be failed, so try the next chunk... 2011 * drives must be failed, so try the next chunk...
2012 */ 2012 */
2013 { 2013 if (sector_nr + max_sync < max_sector)
2014 sector_t sec = max_sector - sector_nr; 2014 max_sector = sector_nr + max_sync;
2015 sectors_skipped += sec; 2015
2016 sectors_skipped += (max_sector - sector_nr);
2016 chunks_skipped ++; 2017 chunks_skipped ++;
2017 sector_nr = max_sector; 2018 sector_nr = max_sector;
2018 goto skipped; 2019 goto skipped;
2019 }
2020} 2020}
2021 2021
2022static int run(mddev_t *mddev) 2022static int run(mddev_t *mddev)