summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-14 18:30:34 +1100
committerNeilBrown <neilb@suse.de>2011-03-14 18:30:34 +1100
commit7590d5623b9f408a29886515ff4f576895d4c13f (patch)
treeb276d965a0905c113ceb89d5b2efa9bf8c91f57a
parente40512fddbb3e8686296ca5100b5f60183981144 (diff)
downloadmdadm-7590d5623b9f408a29886515ff4f576895d4c13f.tar.gz
ddf: minor activate_super fixes.
1/ ignore devices with "state_fd < 0" as these have been removed. 2/ Set update 'length' properly and clear 'space'. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--super-ddf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/super-ddf.c b/super-ddf.c
index 5f7a193..d207215 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -3526,7 +3526,8 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a,
unsigned int j;
/* If in this array, skip */
for (d2 = a->info.devs ; d2 ; d2 = d2->next)
- if (d2->disk.major == dl->major &&
+ if (d2->state_fd >= 0 &&
+ d2->disk.major == dl->major &&
d2->disk.minor == dl->minor) {
dprintf("%x:%x already in array\n", dl->major, dl->minor);
break;
@@ -3639,7 +3640,8 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a,
}
mu->buf = malloc(ddf->conf_rec_len * 512);
- mu->len = ddf->conf_rec_len;
+ mu->len = ddf->conf_rec_len * 512;
+ mu->space = NULL;
mu->next = *updates;
vc = find_vdcr(ddf, a->info.container_member);
memcpy(mu->buf, vc, ddf->conf_rec_len * 512);