summaryrefslogtreecommitdiff
path: root/Incremental.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-10-24 12:06:51 +1100
committerNeilBrown <neilb@suse.de>2012-10-24 12:06:51 +1100
commit72e7fb13f0154eb59941cfbe69e75c830bde4441 (patch)
tree8b24c3bd2c4eb2c3d05c318292d125fc46723eb6 /Incremental.c
parentaacb2f816afbddf56c406039b8e2e6c0dbc8a8a0 (diff)
Incremental: support replacement devices.
These need to be counted in the number of 'active' devices. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Incremental.c b/Incremental.c
index 9b5ac27d..4c889b5f 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -641,6 +641,7 @@ static int count_active(struct supertype *st, struct mdinfo *sra,
/* count how many devices in sra think they are active */
struct mdinfo *d;
int cnt = 0;
+ int replcnt = 0;
__u64 max_events = 0;
char *avail = NULL;
int *best = NULL;
@@ -716,7 +717,8 @@ static int count_active(struct supertype *st, struct mdinfo *sra,
best[info.disk.raid_disk] = devnum;
st->ss->getinfo_super(st, bestinfo, NULL);
}
- }
+ } else if (info.disk.state & (1<<MD_DISK_REPLACEMENT))
+ replcnt++;
st->ss->free_super(st);
}
if (!avail)
@@ -743,7 +745,7 @@ static int count_active(struct supertype *st, struct mdinfo *sra,
}
free(best);
free(devmap);
- return cnt;
+ return cnt + replcnt;
}
/* test if container has degraded member(s) */