From: NeilBrown Date: Mon, 14 Mar 2011 07:30:34 +0000 (+1100) Subject: ddf: minor activate_super fixes. X-Git-Tag: mdadm-3.1.5~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7590d5623b9f408a29886515ff4f576895d4c13f;p=thirdparty%2Fmdadm.git 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 --- diff --git a/super-ddf.c b/super-ddf.c index 5f7a193e..d2072158 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);