]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: include ACTIVE but not in-sync devices as non-spares.
authorNeilBrown <neilb@suse.de>
Tue, 17 Nov 2009 01:30:54 +0000 (12:30 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 17 Nov 2009 01:30:54 +0000 (12:30 +1100)
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 <neilb@suse.de>
Assemble.c
md_p.h
super-ddf.c
super1.c

index a52dc50dc4c4f6b32bef6bae944895265a9c3a08..a16cafe2c5be0c5f3cbc327faf8e207e79d2cd3d 100644 (file)
@@ -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<<MD_DISK_SYNC))) {
+                       if (!(devices[j].i.disk.state & (1<<MD_DISK_ACTIVE))) {
                                if (!(devices[j].i.disk.state
                                      & (1<<MD_DISK_FAULTY)))
                                        sparecnt++;
diff --git a/md_p.h b/md_p.h
index a9f0204c754a4ab9ac12d02ff5e182910b45cca1..4594a36a89ff90217c6f0d9fbfcd87e3326c458e 100644 (file)
--- a/md_p.h
+++ b/md_p.h
@@ -75,7 +75,7 @@
  * Device "operational" state bits
  */
 #define MD_DISK_FAULTY         0 /* disk is faulty / operational */
-#define MD_DISK_ACTIVE         1 /* disk is running or spare disk */
+#define MD_DISK_ACTIVE         1 /* disk is running but may not be in sync */
 #define MD_DISK_SYNC           2 /* disk is in sync with the raid set */
 #define MD_DISK_REMOVED                3 /* disk is in sync with the raid set */
 
index 06858e23fb9cbc3f0fc94874c2b9905d9a6ca73a..80df570f2d6c6bb83cccdc06c8240dfccd3b71a1 100644 (file)
@@ -1366,7 +1366,7 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info)
                info->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;
index a64876e1bad374af4cda4c0c45e5934d0a30dfb6..667154d139b343b19c407d4d9d12323e7a4c72b7 100644 (file)
--- 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 */