]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: support assembling of a RAID0 being reshaped.
authorNeilBrown <neilb@suse.de>
Tue, 6 Mar 2012 23:47:34 +0000 (10:47 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 6 Mar 2012 23:47:34 +0000 (10:47 +1100)
This is a bit of a hack and the code need to be made more
general.  But this adds the special case of a RAID0 being
reshaped which looks like a RAID4 but doesn't need as many
devices.

Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c

index 0af8ad86f8119b6f5d15e1c7174605814f1231e5..fadacf5f7e9cbbe9b338edb6c4c10b98ac1e317c 100644 (file)
@@ -976,7 +976,9 @@ int Assemble(struct supertype *st, char *mddev,
                        if (i < content->array.raid_disks) {
                                if (devices[j].i.recovery_start == MaxSector ||
                                    (content->reshape_active &&
-                                    j >= content->array.raid_disks - content->delta_disks)) {
+                                    ((i >= content->array.raid_disks - content->delta_disks) ||
+                                     (i >= content->array.raid_disks - content->delta_disks - 1
+                                      && content->array.level == 4)))) {
                                        okcnt++;
                                        avail[i]=1;
                                } else