From: Dan Williams Date: Tue, 28 Oct 2008 17:55:31 +0000 (-0700) Subject: imsm: return associated uuid for spares X-Git-Tag: mdadm-3.0-devel2~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a575e2a7cd4533c0cfc8de08daddec9854e0df71;p=thirdparty%2Fmdadm.git imsm: return associated uuid for spares This prevents a uuid of all f's from being displayed when an imsm spare is listed along with active disks for mdadm -Eb. Signed-off-by: Dan Williams --- diff --git a/super-intel.c b/super-intel.c index d176dfd0..babb0984 100644 --- a/super-intel.c +++ b/super-intel.c @@ -825,7 +825,11 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info) info->disk.state |= s & FAILED_DISK ? (1 << MD_DISK_FAULTY) : 0; info->disk.state |= s & SPARE_DISK ? 0 : (1 << MD_DISK_SYNC); } - if (info->disk.state & (1 << MD_DISK_SYNC)) + + /* only call uuid_from_super_imsm when this disk is part of a populated container, + * ->compare_super may have updated the 'num_raid_devs' field for spares + */ + if (info->disk.state & (1 << MD_DISK_SYNC) || super->anchor->num_raid_devs) uuid_from_super_imsm(st, info->uuid); else memcpy(info->uuid, uuid_match_any, sizeof(int[4]));