summaryrefslogtreecommitdiff
path: root/super-ddf.c
diff options
context:
space:
mode:
authormwilck@arcor.de <mwilck@arcor.de>2013-08-05 22:37:50 +0200
committerNeilBrown <neilb@suse.de>2013-08-06 09:54:47 +1000
commit60056e1c3df6541811135f8eafa0b356a49a4453 (patch)
tree6b0ae59bccbeb9dc7c83111855cf50417171df24 /super-ddf.c
parent6b924b1e9fdef07596f30f8dfadec66192c4377c (diff)
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>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/super-ddf.c b/super-ddf.c
index b352a52a..b7c61429 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -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));