]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Detail: support MD_DEVNAME in --export for metadata-less devices.
authorNeilBrown <neilb@suse.de>
Tue, 4 Nov 2008 09:50:39 +0000 (20:50 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 4 Nov 2008 09:50:39 +0000 (20:50 +1100)
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>
Detail.c

index bda68de028edb7aab134cf64bb179ea05d2e96ef..5ff8cd138fd759d6ae2e1ecd1b180d7a7eab1404 100644 (file)
--- 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;
        }