summaryrefslogtreecommitdiff
path: root/Detail.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-11-04 20:50:39 +1100
committerNeilBrown <neilb@suse.de>2008-11-04 20:50:39 +1100
commit7e6c6cb26790e4b0de2e8694cca655db26bee11a (patch)
treef6b92a7c7ed441c9768698c407da7b769907c6f4 /Detail.c
parent4ccad7b163fd5f210883d10b2fd36dcc90436b71 (diff)
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 <neilb@suse.de>
Diffstat (limited to 'Detail.c')
-rw-r--r--Detail.c6
1 files changed, 6 insertions, 0 deletions
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;
}