diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/lvm/libmeta/common/meta_mirror.c | 17 | ||||
-rw-r--r-- | usr/src/lib/lvm/libmeta/common/meta_name.c | 10 |
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, |