summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-10-20 13:25:30 +1000
committerChris Wright <chrisw@sous-sol.org>2006-11-03 17:33:47 -0800
commit8fb3dd17ba82cf264224fc19c69efb42e4370f28 (patch)
tree87ffc9f180d205a0b7039098c601048479f57e58
parent563f2416b31884d196f194bcca580f8226b1dc4a (diff)
[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 <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
-rw-r--r--drivers/md/multipath.c2
-rw-r--r--drivers/md/raid10.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 1cc9de44ce86..33f67caa9170 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 016ddb831c9b..115a6f866a87 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++;
}