]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: determine failed indexes from the most up-to-date disk
authorDan Williams <dan.j.williams@intel.com>
Sun, 28 Sep 2008 19:12:07 +0000 (12:12 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 15 Oct 2008 21:15:51 +0000 (14:15 -0700)
load_imsm_disk() currently notices if spares missed their activation
update, but we allow a stale failed disk back in to the array because its
serial number is clobbered in the most up-to-date disk.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
super-intel.c

index 7f8dd3483271796a3dd5a53381f33a6c7fbf870e..df3184aae000fba5620b40f582505208e8e949ee 100644 (file)
@@ -1097,6 +1097,13 @@ load_imsm_disk(int fd, struct intel_super *super, char *devname, int keep_fd)
                }
        }
 
+       /* no match, maybe a stale failed drive */
+       if (i == super->anchor->num_disks && dl->index >= 0) {
+               dl->disk = *__get_imsm_disk(super->anchor, dl->index);
+               if (__le32_to_cpu(dl->disk.status) & FAILED_DISK)
+                       dl->index = -2;
+       }
+
        if (alloc)
                super->disks = dl;