Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e333e89 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds
Browse files

[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>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3c5473f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -501,7 +501,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));
+1 −1
Original line number Diff line number Diff line
@@ -2079,7 +2079,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++;
		}