summaryrefslogtreecommitdiff
path: root/Detail.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-10-13 17:41:57 -0700
committerDan Williams <dan.j.williams@intel.com>2009-10-13 17:41:57 -0700
commitaae5a11207cf6da1682e6a76e116a19e21473f03 (patch)
tree795953d4c515c82e2a43027e3f2861dc53efc77a /Detail.c
parentd2b9eb5993b6c36bf1d66980811bda1b6eefb19f (diff)
Detail: export MD_UUID from mapfile
The load_super() from an mdadm --detail call may race against an mdmon update. When this happens the load_super sees an inconsistent metadata block and returns an error. The fallback path to use the map file contents lacks uuid reporting, so provide __fname_from_uuid for generically printing a uuid. Reported-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'Detail.c')
-rw-r--r--Detail.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Detail.c b/Detail.c
index 001012a2..1598a425 100644
--- a/Detail.c
+++ b/Detail.c
@@ -194,7 +194,12 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
st->ss->export_detail_super(st);
} else {
struct map_ent *mp, *map = NULL;
+ char nbuf[64];
mp = map_by_devnum(&map, fd2devnum(fd));
+ if (mp) {
+ __fname_from_uuid(mp->uuid, 0, nbuf, ':');
+ printf("MD_UUID=%s\n", nbuf+5);
+ }
if (mp && mp->path &&
strncmp(mp->path, "/dev/md/", 8) == 0)
printf("MD_DEVNAME=%s\n", mp->path+8);