We should skip known failed disks when allocating space for
new arrays. This fixes the problem with 10ddf-fail-spare.
Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
struct extent *rv;
int n = 0;
unsigned int i;
+ __u16 state = be16_to_cpu(ddf->phys->entries[dl->pdnum].state);
+
+ if ((state & (DDF_Online|DDF_Failed|DDF_Missing)) != DDF_Online)
+ return NULL;
rv = xmalloc(sizeof(struct extent) * (ddf->max_part + 2));