Skip to content

Commit

Permalink
[PATCH] md: fix calculation of ->degraded for multipath and raid10
Browse files Browse the repository at this point in the history
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>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Oct 21, 2006
1 parent 3c5473f commit 2e333e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/md/multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit 2e333e8

Please sign in to comment.