X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=blobdiff_plain;f=Detail.c;h=001012a211cb38e85c8499222a0a0756f8f880ee;hp=ab01cfb4b59092cfbd84c19808135ed995aa681a;hb=436305c6905f81735eb04e9ef6577c21358836e8;hpb=ee836c39b503e67b895a7ebabee8208a7ff0fea8 diff --git a/Detail.c b/Detail.c index ab01cfb4..001012a2 100644 --- a/Detail.c +++ b/Detail.c @@ -122,12 +122,25 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) disk.minor == 0) continue; if ((dv=map_dev(disk.major, disk.minor, 1))) { - if ((!st || !st->sb) && + /* some formats (imsm) have free-floating-spares + * with a uuid of uuid_match_any, they don't + * have very good info about the rest of the + * container, so keep searching when + * encountering such a device. Otherwise, stop + * after the first successful call to + * ->load_super. + */ + int free_spare = memcmp(uuid_match_any, + info.uuid, + sizeof(uuid_match_any)) == 0; + if ((!st || !st->sb || free_spare) && (array.raid_disks == 0 || (disk.state & (1<ss->free_super(st); int fd2 = dev_open(dv, O_RDONLY); if (fd2 >=0 && st && st->ss->load_super(st, fd2, NULL) == 0) {