From: NeilBrown Date: Tue, 17 Nov 2009 01:30:54 +0000 (+1100) Subject: Assemble: include ACTIVE but not in-sync devices as non-spares. X-Git-Tag: mdadm-3.1.1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f22385f9826bcf35c8055c3b89b731f5760a46c5;p=thirdparty%2Fmdadm.git Assemble: include ACTIVE but not in-sync devices as non-spares. Previously such things did not exist: ACTIVE and SYNC were either both set or both clear. Recent changes with reshape means that a device can be ACTIVE but not yet fully in-sync, so they need to be handled and included in the array as active devices. Signed-off-by: NeilBrown --- diff --git a/Assemble.c b/Assemble.c index a52dc50d..a16cafe2 100644 --- a/Assemble.c +++ b/Assemble.c @@ -777,7 +777,7 @@ int Assemble(struct supertype *st, char *mddev, * as they don't make sense */ if (content->array.level != -4) - if (!(devices[j].i.disk.state & (1<disk.raid_disk = -1; // info->disk.raid_disk = find refnum in the table and use index; } - info->disk.state = (1 << MD_DISK_SYNC); + info->disk.state = (1 << MD_DISK_SYNC) | (1 << MD_DISK_ACTIVE); info->reshape_active = 0; diff --git a/super1.c b/super1.c index a64876e1..667154d1 100644 --- a/super1.c +++ b/super1.c @@ -594,7 +594,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info) info->disk.raid_disk = -1; switch(role) { case 0xFFFF: - info->disk.state = 2; /* spare: ACTIVE, not sync, not faulty */ + info->disk.state = 0; /* spare: not active, not sync, not faulty */ break; case 0xFFFE: info->disk.state = 1; /* faulty */