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>
This commit is contained in:
NeilBrown 2008-11-04 20:50:39 +11:00
parent 4ccad7b163
commit 7e6c6cb267
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}