summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-01-14 09:14:34 +1100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 14:47:24 -0800
commit0addbdd392125780ac65bcd9dcf69eae2afb9c01 (patch)
tree6b0a7272c112588486a9fb4f8a3290f9f111a189
parent7896fe54a75c5bfd8dfed08d98cb7e15896e3749 (diff)
md: Fix removal of extra drives when converting RAID6 to RAID5
commit bf2cb0dab8c97f00a71875d9b13dbac17a2f47ca upstream. 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. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 94bb484973a3..e8de9083ccd6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3111,7 +3111,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
char nm[20];
if (rdev->raid_disk < 0)
continue;
- if (rdev->new_raid_disk > mddev->raid_disks)
+ if (rdev->new_raid_disk >= mddev->raid_disks)
rdev->new_raid_disk = -1;
if (rdev->new_raid_disk == rdev->raid_disk)
continue;