]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: ensure 'usable' remains clear until the disk is in_sync
authorDan Williams <dan.j.williams@intel.com>
Sun, 10 Aug 2008 03:28:24 +0000 (20:28 -0700)
committerDan Williams <dan.j.williams@intel.com>
Mon, 11 Aug 2008 08:16:24 +0000 (01:16 -0700)
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
super-intel.c

index 632ddd9a09b10c8cb4f46c9f3b053195324e3053..b8beb8eb170ea2a16614a23f12c0b516decb8790 100644 (file)
@@ -2203,6 +2203,12 @@ static void imsm_set_disk(struct active_array *a, int n, int state)
                new_failure = 1;
                super->updates_pending++;
        }
+       /* check if in_sync */
+       if ((state & DS_INSYNC) && !(status & USABLE_DISK)) {
+               status |= USABLE_DISK;
+               disk->status = __cpu_to_le32(status);
+               super->updates_pending++;
+       }
 
        /* the number of failures have changed, count up 'failed' to determine
         * degraded / failed status
@@ -2511,7 +2517,7 @@ static void imsm_process_update(struct supertype *st,
                disk = &dl->disk;
                status = __le32_to_cpu(disk->status);
                status |= CONFIGURED_DISK;
-               status &= ~SPARE_DISK;
+               status &= ~(SPARE_DISK | USABLE_DISK);
                disk->status = __cpu_to_le32(status);
 
                /* count arrays using the victim in the metadata */