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:
parent
4ccad7b163
commit
7e6c6cb267
6
Detail.c
6
Detail.c
|
@ -184,6 +184,12 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
|
||||||
|
|
||||||
if (st->ss->export_detail_super)
|
if (st->ss->export_detail_super)
|
||||||
st->ss->export_detail_super(st);
|
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;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue