On Thu, Sep 1, 2011 at 6:18 AM, Lukasz Dorau <lukasz.dorau@xxxxxxxxx> wrote: > Description of the bug: > Interrupted reshape cannot be continued using incremental assembly. > Array becomes inactive. > > Cause of the bug: > Reshape tried to continue with insufficient number of disks > added by incremental assembly (tested using capacity expansion). > > Solution: > During reshape adding disks to array should be blocked until > minimum required number of disks is ready to be added. Can you provide a script test-case to reproduce the problem? > Signed-off-by: Lukasz Dorau <lukasz.dorau@xxxxxxxxx> > --- > Assemble.c | 39 +++++++++++++++++++++++++++++++++++++++ > 1 files changed, 39 insertions(+), 0 deletions(-) > > diff --git a/Assemble.c b/Assemble.c > index 25cfec1..da43162 100644 > --- a/Assemble.c > +++ b/Assemble.c > @@ -1531,6 +1531,45 @@ int assemble_container_content(struct supertype *st, int mdfd, > > if (sra) > sysfs_free(sra); > + if (content->reshape_active) { > + int disks_counter = 0; > + int required_disks; > + required_disks = content->array.raid_disks; > + /* check if disks are removed */ > + if (content->delta_disks < 0) > + required_disks += content->delta_disks; > + /* Count devices available for assemblation. > + * In case of incremental assemblation during reshape > + * allow to add disks only if required minimum number of disks > + * is already collected to avoid assemblation problem. > + * */ > + for (dev = content->devs; dev; dev = dev->next) { > + if (dev->disk.raid_disk >= 0) > + disks_counter++; > + } > + /* allow for degradation */ > + switch (content->array.level) { > + case 6: > + required_disks--; > + case 4: > + case 5: > + required_disks--; > + default: > + break; > + } > + /* check now, if number of disks allows for assemblation > + * */ > + if (disks_counter < required_disks) { > + if (verbose >= 0) > + fprintf(stderr, Name > + ": %s not assembled with %d devices " > + "(required disks for assemblation: %i).\n", > + chosen_name, disks_counter, > + required_disks); > + return 1; > + } > + block_subarray(content); > + } Checking that the expected number of disks is available is something the existing code already does, so I don't understand why we need another open-coded check? -- 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