]> git.hungrycats.org Git - linux/commitdiff
[PATCH] md: Fix calculation of ->degraded for multipath and raid10
authorNeilBrown <neilb@suse.de>
Fri, 20 Oct 2006 03:25:30 +0000 (13:25 +1000)
committerChris Wright <chrisw@sous-sol.org>
Sat, 4 Nov 2006 01:33:47 +0000 (17:33 -0800)
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>
drivers/md/multipath.c
drivers/md/raid10.c

index 1cc9de44ce86c2cce64c58fb72d8b3f33245a83f..33f67caa91701424d6fab287a6a3cca6ad583e23 100644 (file)
@@ -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));
index 016ddb831c9b393dfb44c52076dbcbc4f4750b96..115a6f866a8737942d0fff45fb8ed143be87e263 100644 (file)
@@ -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++;
                }