From 8fb3dd17ba82cf264224fc19c69efb42e4370f28 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 20 Oct 2006 13:25:30 +1000 Subject: [PATCH] [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: Neil Brown Signed-off-by: Greg Kroah-Hartman Signed-off-by: Chris Wright --- drivers/md/multipath.c | 2 +- drivers/md/raid10.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 1cc9de44ce86c..33f67caa91701 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c @@ -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)); diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 016ddb831c9b3..115a6f866a873 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -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++; } -- 2.47.2