Only one spare is passed in update. When more than one disk is added first spare is passed multiple times. Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- super-intel.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/super-intel.c b/super-intel.c index ef51000..321dc47 100644 --- a/super-intel.c +++ b/super-intel.c @@ -6448,6 +6448,7 @@ static int imsm_create_metadata_update_for_reshape( struct mdinfo *spares = NULL; int i; int delta_disks = 0; + struct mdinfo *dev; dprintf("imsm_update_metadata_for_reshape(enter) raid_disks = %i\n", geo->raid_disks); @@ -6486,15 +6487,18 @@ static int imsm_create_metadata_update_for_reshape( dprintf("imsm: %i spares are available.\n\n", spares->array.spare_disks); + dev = spares->devs; for (i = 0; i < delta_disks; i++) { - struct mdinfo *dev = spares->devs; struct dl *dl; + if (dev == NULL) + break; u->new_disks[i] = makedev(dev->disk.major, dev->disk.minor); dl = get_disk_super(super, dev->disk.major, dev->disk.minor); dl->index = mpb->num_disks; mpb->num_disks++; + dev = dev->next; } abort: -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html