From: NeilBrown Date: Tue, 4 Nov 2008 09:50:39 +0000 (+1100) Subject: Detail: support MD_DEVNAME in --export for metadata-less devices. X-Git-Tag: mdadm-3.0-devel2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e6c6cb26790e4b0de2e8694cca655db26bee11a;p=thirdparty%2Fmdadm.git Detail: support MD_DEVNAME in --export for metadata-less devices. If there is no metadata (--build was used) then we need to lookup by devnum, not by uuid, to get the map entry. Signed-off-by: NeilBrown --- diff --git a/Detail.c b/Detail.c index bda68de0..5ff8cd13 100644 --- a/Detail.c +++ b/Detail.c @@ -184,6 +184,12 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) if (st->ss->export_detail_super) st->ss->export_detail_super(st); + } else { + struct map_ent *mp, *map = NULL; + mp = map_by_devnum(&map, fd2devnum(fd)); + if (mp && mp->path && + strncmp(mp->path, "/dev/md/", 8) == 0) + printf("MD_DEVNAME=%s\n", mp->path+8); } goto out; }