summaryrefslogtreecommitdiff
path: root/super-ddf.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-03 09:04:42 +1100
committerNeilBrown <neilb@suse.de>2011-03-03 09:04:42 +1100
commitfa033beca9ad714d05b47b0e7d2df555797761ec (patch)
tree11278b1aad950c94aca584df9ac0d208f53b21fa /super-ddf.c
parentc870b7dda3d22d2bd232125403b891706ce886c6 (diff)
ddf: exclude failed devices from container_content
If a device is failed, then don't include it in the reported container_content, else it might get included in the array. Reported-by: Albert Pauw <albert.pauw@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/super-ddf.c b/super-ddf.c
index dba59703..141731a3 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -2974,18 +2974,23 @@ static struct mdinfo *container_content_ddf(struct supertype *st)
for (i = 0 ; i < ddf->mppe ; i++) {
struct mdinfo *dev;
struct dl *d;
+ int stt;
if (vc->conf.phys_refnum[i] == 0xFFFFFFFF)
continue;
- this->array.working_disks++;
-
for (d = ddf->dlist; d ; d=d->next)
if (d->disk.refnum == vc->conf.phys_refnum[i])
break;
if (d == NULL)
/* Haven't found that one yet, maybe there are others */
continue;
+ stt = __be16_to_cpu(ddf->phys->entries[d->pdnum].state);
+ if ((stt & (DDF_Online|DDF_Failed|DDF_Rebuilding))
+ != DDF_Online)
+ continue;
+
+ this->array.working_disks++;
dev = malloc(sizeof(*dev));
memset(dev, 0, sizeof(*dev));