Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230656
b: refs/heads/master
c: 1a940fc
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown committed Jan 13, 2011
1 parent 09898ce commit 8e24064
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 13ae864bc86ff65547ffe7e966b6433a0d0edb8a
refs/heads/master: 1a940fcee31ec6c18c2f24dbdad31d54e4c35048
9 changes: 7 additions & 2 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -5527,8 +5527,8 @@ static int raid5_start_reshape(mddev_t *mddev)
return -ENOSPC;

list_for_each_entry(rdev, &mddev->disks, same_set)
if (rdev->raid_disk < 0 &&
!test_bit(Faulty, &rdev->flags))
if ((rdev->raid_disk < 0 || rdev->raid_disk >= conf->raid_disks)
&& !test_bit(Faulty, &rdev->flags))
spares++;

if (spares - mddev->degraded < mddev->delta_disks - conf->max_degraded)
Expand Down Expand Up @@ -5588,6 +5588,11 @@ static int raid5_start_reshape(mddev_t *mddev)
/* Failure here is OK */;
} else
break;
} else if (rdev->raid_disk >= conf->previous_raid_disks
&& !test_bit(Faulty, &rdev->flags)) {
/* This is a spare that was manually added */
set_bit(In_sync, &rdev->flags);
added_devices++;
}

/* When a reshape changes the number of devices, ->degraded
Expand Down

0 comments on commit 8e24064

Please sign in to comment.