aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e84204eb12d..b5629c3e14f 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5464,11 +5464,11 @@ static int raid5_start_reshape(mddev_t *mddev)
5464 !test_bit(Faulty, &rdev->flags)) { 5464 !test_bit(Faulty, &rdev->flags)) {
5465 if (raid5_add_disk(mddev, rdev) == 0) { 5465 if (raid5_add_disk(mddev, rdev) == 0) {
5466 char nm[20]; 5466 char nm[20];
5467 if (rdev->raid_disk >= conf->previous_raid_disks) 5467 if (rdev->raid_disk >= conf->previous_raid_disks) {
5468 set_bit(In_sync, &rdev->flags); 5468 set_bit(In_sync, &rdev->flags);
5469 else 5469 added_devices++;
5470 } else
5470 rdev->recovery_offset = 0; 5471 rdev->recovery_offset = 0;
5471 added_devices++;
5472 sprintf(nm, "rd%d", rdev->raid_disk); 5472 sprintf(nm, "rd%d", rdev->raid_disk);
5473 if (sysfs_create_link(&mddev->kobj, 5473 if (sysfs_create_link(&mddev->kobj,
5474 &rdev->kobj, nm)) 5474 &rdev->kobj, nm))
@@ -5480,9 +5480,12 @@ static int raid5_start_reshape(mddev_t *mddev)
5480 break; 5480 break;
5481 } 5481 }
5482 5482
5483 /* When a reshape changes the number of devices, ->degraded
5484 * is measured against the large of the pre and post number of
5485 * devices.*/
5483 if (mddev->delta_disks > 0) { 5486 if (mddev->delta_disks > 0) {
5484 spin_lock_irqsave(&conf->device_lock, flags); 5487 spin_lock_irqsave(&conf->device_lock, flags);
5485 mddev->degraded = (conf->raid_disks - conf->previous_raid_disks) 5488 mddev->degraded += (conf->raid_disks - conf->previous_raid_disks)
5486 - added_devices; 5489 - added_devices;
5487 spin_unlock_irqrestore(&conf->device_lock, flags); 5490 spin_unlock_irqrestore(&conf->device_lock, flags);
5488 } 5491 }