md: don't abort checking spares as soon as one cannot be added.
authorNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 00:57:43 +0000 (11:57 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 00:57:43 +0000 (11:57 +1100)
As spares can be added manually before a reshape starts, we need to
find them all to mark some of them as in_sync.

Previously we would abort looking for spares when we found an
unallocated spare what could not be added to the array (implying there
was no room for new spares).  However already-added spares could be
later in the list, so we need to keep searching.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c

index a6d2c3ddeee4775d3690ba79236f15b873d16496..702812824195ae7c0a6333381659575f552a8f62 100644 (file)
@@ -5587,8 +5587,7 @@ static int raid5_start_reshape(mddev_t *mddev)
                                        if (sysfs_create_link(&mddev->kobj,
                                                              &rdev->kobj, nm))
                                                /* 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 */