Commit 8fb3dd17 authored by NeilBrown's avatar NeilBrown Committed by Chris Wright

[PATCH] md: Fix calculation of ->degraded for multipath and raid10

Two less-used md personalities have bugs in the calculation of
 ->degraded (the extent to which the array is degraded).
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
parent 563f2416
......@@ -480,7 +480,7 @@ static int multipath_run (mddev_t *mddev)
mdname(mddev));
goto out_free_conf;
}
mddev->degraded = conf->raid_disks = conf->working_disks;
mddev->degraded = conf->raid_disks - conf->working_disks;
conf->pool = mempool_create_kzalloc_pool(NR_RESERVED_BUFS,
sizeof(struct multipath_bh));
......
......@@ -2042,7 +2042,7 @@ static int run(mddev_t *mddev)
disk = conf->mirrors + i;
if (!disk->rdev ||
!test_bit(In_sync, &rdev->flags)) {
!test_bit(In_sync, &disk->rdev->flags)) {
disk->head_position = 0;
mddev->degraded++;
}
......
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