summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorjmf <none@none>2007-05-02 01:39:51 -0700
committerjmf <none@none>2007-05-02 01:39:51 -0700
commit32e0da9f9721fdfe44802ab869bc447dc4357bc6 (patch)
treeaddf04a1f991691af09a659ef23f6d4b637802e2 /usr/src
parentd3b725e92679d77ba59478d24adfb899992037b9 (diff)
downloadillumos-gate-32e0da9f9721fdfe44802ab869bc447dc4357bc6.tar.gz
6500051 metattach dXX dYY produces message "metattach: hostname: /dev/md/dsk/dZZ: not a metadevice"
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/lib/lvm/libmeta/common/meta_mirror.c17
-rw-r--r--usr/src/lib/lvm/libmeta/common/meta_name.c10
2 files changed, 25 insertions, 2 deletions
diff --git a/usr/src/lib/lvm/libmeta/common/meta_mirror.c b/usr/src/lib/lvm/libmeta/common/meta_mirror.c
index a0380778dd..f1426a7185 100644
--- a/usr/src/lib/lvm/libmeta/common/meta_mirror.c
+++ b/usr/src/lib/lvm/libmeta/common/meta_mirror.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -300,6 +300,7 @@ meta_check_primary_mirror(
{
int smi;
char *curroot;
+ char *temproot;
mdname_t *rootnp;
md_mirror_t *mirrorp;
md_stripe_t *stripep;
@@ -308,6 +309,20 @@ meta_check_primary_mirror(
if ((curroot = meta_get_current_root(ep)) == NULL)
return (-1);
+
+ /*
+ * We need to take the canonical name here otherwise the call to
+ * metaname will add a bad entry to the drivelistp cache and
+ * things will get nasty later on.
+ * However we also need to trap the case where we have a logical
+ * device name and meta_canonicalize returns NULL.
+ */
+ temproot = meta_canonicalize(sp, curroot);
+ if (temproot != NULL) {
+ curroot = Strdup(temproot);
+ Free(temproot);
+ }
+
/*
* Get device name of current root metadevice. If root
* is net mounted as happens if we're part of the
diff --git a/usr/src/lib/lvm/libmeta/common/meta_name.c b/usr/src/lib/lvm/libmeta/common/meta_name.c
index c9aa05185d..0b5e7639e8 100644
--- a/usr/src/lib/lvm/libmeta/common/meta_name.c
+++ b/usr/src/lib/lvm/libmeta/common/meta_name.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2600,6 +2600,14 @@ out:
return (NULL);
}
+/*
+ * metaname()
+ *
+ * Wrapper function for metaname_common()
+ * If the second arg is a metadevice name then it is important that this should
+ * be a canonical name (eg d30 rather than /dev/md/dsk/d30). If this is not the
+ * case then a bad entry may be placed into the drivelistp cache.
+ */
mdname_t *
metaname(
mdsetname_t **spp,