Commit 3285edf1 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[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: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b3cc9ec7
...@@ -2858,7 +2858,7 @@ static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *ski ...@@ -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 * to resync, then assert that we are finished, because there is
* nothing we can do. * nothing we can do.
*/ */
if (mddev->degraded >= (data_disks - raid_disks) && if (mddev->degraded >= conf->max_degraded &&
test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
sector_t rv = (mddev->size << 1) - sector_nr; sector_t rv = (mddev->size << 1) - sector_nr;
*skipped = 1; *skipped = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment