From 60056e1c3df6541811135f8eafa0b356a49a4453 Mon Sep 17 00:00:00 2001 From: "mwilck@arcor.de" Date: Mon, 5 Aug 2013 22:37:50 +0200 Subject: [PATCH] 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 Signed-off-by: NeilBrown --- super-ddf.c | 4 ++++ 1 file changed, 4 insertions(+) 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)); -- 2.47.2