diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index d037adb295ac5..86b8aaf91baa6 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -2772,6 +2772,12 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, /* want to reconstruct this device */ rb2 = r10_bio; sect = raid10_find_virt(conf, sector_nr, i); + if (sect >= mddev->resync_max_sectors) { + /* last stripe is not complete - don't + * try to recover this sector. + */ + continue; + } /* Unless we are doing a full sync, or a replacement * we only need to recover the block if it is set in * the bitmap