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

Commit bf2cb0da authored by NeilBrown's avatar NeilBrown
Browse files

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 e93f68a1 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: default avatarNeilBrown <neilb@suse.de>
parent ba1b41b6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3126,7 +3126,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;