From: NeilBrown Date: Mon, 26 Jun 2006 07:27:55 +0000 (-0700) Subject: [PATCH] md: Fix bug that stops raid5 resync from happening X-Git-Tag: v2.6.18-rc1~625 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3285edf152cefff482f95ceb90b1bd46ac169df1;p=linux-2.6 [PATCH] md: Fix bug that stops raid5 resync from happening As data_disks is *less* than raid_disks, the current test here is obviously wrong. And as the difference is already available in conf->max_degraded, it makes much more sense to use that. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 6d3a2a09cd..f920e50ea1 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -2858,7 +2858,7 @@ static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *ski * to resync, then assert that we are finished, because there is * nothing we can do. */ - if (mddev->degraded >= (data_disks - raid_disks) && + if (mddev->degraded >= conf->max_degraded && test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { sector_t rv = (mddev->size << 1) - sector_nr; *skipped = 1;