diff options
author | NeilBrown <neilb@suse.de> | 2012-10-25 07:38:11 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-10-25 07:38:11 +0200 |
commit | 4610608a023b461e6e778d485a75b8a989247edb (patch) | |
tree | 4e87fda4572284f863801173cb4c41ef03d21be2 /Query.c | |
parent | Query: don't be confused by partition tables. (diff) | |
download | mdadm-4610608a023b461e6e778d485a75b8a989247edb.tar.xz mdadm-4610608a023b461e6e778d485a75b8a989247edb.zip |
Query: allow member of non-0.90 arrays to be better reported.
Currently if a member of a 1.x array is queried, mdadm will
fail to find the name of the active md array if there is one.
Change the lookup to use the mapfile - now it works.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Query.c')
-rw-r--r-- | Query.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -89,9 +89,13 @@ int Query(char *dev) close(fd); if (superror == 0) { /* array might be active... */ + int uuid[4]; + struct map_ent *me, *map = NULL; st->ss->getinfo_super(st, &info, NULL); - if (st->ss == &super0) { - mddev = get_md_name(info.array.md_minor); + st->ss->uuid_from_super(st, uuid); + me = map_by_uuid(&map, uuid); + if (me) { + mddev = me->path; disc.number = info.disk.number; activity = "undetected"; if (mddev && (fd = open(mddev, O_RDONLY))>=0) { @@ -106,7 +110,7 @@ int Query(char *dev) close(fd); } } else { - activity = "unknown"; + activity = "inactive"; mddev = "array"; } printf("%s: device %d in %d device %s %s %s. Use mdadm --examine for more detail.\n", |