aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-01-13 17:14:34 -0500
committerNeilBrown <neilb@suse.de>2011-01-13 17:14:34 -0500
commitbf2cb0dab8c97f00a71875d9b13dbac17a2f47ca (patch)
tree68587eaff5c7cb85628c1f68aecb19f2a18c8f6e /drivers
parentba1b41b6b4e30cb66ae2775faadea05cae3ce61c (diff)
md: Fix removal of extra drives when converting RAID6 to RAID5
When a RAID6 is converted to a RAID5, the extra drive should be discarded. However it isn't due to a typo in a comparison. This bug was introduced in commit e93f68a1fc6 in 2.6.35-rc4 and is suitable for any -stable since than. As the extra drive is not removed, the 'degraded' counter is wrong and so the RAID5 will not respond correctly to a subsequent failure. Cc: stable@kernel.org Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 665851308818..3194a80f3620 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3126,7 +3126,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
3126 char nm[20]; 3126 char nm[20];
3127 if (rdev->raid_disk < 0) 3127 if (rdev->raid_disk < 0)
3128 continue; 3128 continue;
3129 if (rdev->new_raid_disk > mddev->raid_disks) 3129 if (rdev->new_raid_disk >= mddev->raid_disks)
3130 rdev->new_raid_disk = -1; 3130 rdev->new_raid_disk = -1;
3131 if (rdev->new_raid_disk == rdev->raid_disk) 3131 if (rdev->new_raid_disk == rdev->raid_disk)
3132 continue; 3132 continue;