From 7e6c6cb26790e4b0de2e8694cca655db26bee11a Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 4 Nov 2008 20:50:39 +1100 Subject: [PATCH] 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 --- Detail.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Detail.c b/Detail.c index bda68de..5ff8cd1 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; }