DDF: get_extents: don't allocate space on failed disks

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>
This commit is contained in:
mwilck@arcor.de 2013-08-05 22:37:50 +02:00 committed by NeilBrown
parent 6b924b1e9f
commit 60056e1c3d
1 changed files with 4 additions and 0 deletions

View File

@ -2390,6 +2390,10 @@ static struct extent *get_extents(struct ddf_super *ddf, struct dl *dl)
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));