summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorachimm <none@none>2006-10-19 14:29:42 -0700
committerachimm <none@none>2006-10-19 14:29:42 -0700
commitddd5970d633e7d77e3533347b882ba60b95469f4 (patch)
treebcf1ca342c86b0fbf6184f8d56bb201c960893d3 /usr
parent20a07c4895fc562163c891d882c4602d75328ea4 (diff)
downloadillumos-joyent-ddd5970d633e7d77e3533347b882ba60b95469f4.tar.gz
6448006 4 node system paniced after adding some more disks to an existing metaset
Diffstat (limited to 'usr')
-rw-r--r--usr/src/uts/common/io/lvm/md/md_names.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr/src/uts/common/io/lvm/md/md_names.c b/usr/src/uts/common/io/lvm/md/md_names.c
index 05cdcbfccf..87a4ff7781 100644
--- a/usr/src/uts/common/io/lvm/md/md_names.c
+++ b/usr/src/uts/common/io/lvm/md/md_names.c
@@ -2083,6 +2083,18 @@ md_setdevname(
} else {
min_devid_key = did_n->min_devid_key;
min_len = (size_t)did_n->min_namlen;
+ /*
+ * Need to save the min_name as well because
+ * if the alloc_entry() needs to expand the
+ * record then it will free the existing
+ * record (which will free any references
+ * to information within it ie did_n->min_name)
+ */
+ if (mname != NULL) {
+ kmem_free(mname, strlen(mname) + 1);
+ }
+ mname = kmem_alloc(min_len, KM_SLEEP);
+ (void) strcpy(mname, did_n->min_name);
}
} else {
@@ -2146,7 +2158,7 @@ add_devid:
cmn_err(CE_NOTE,
"addname: failed to add to record");
}
- (void) strcpy(new_did_n->min_name, did_n->min_name);
+ (void) strcpy(new_did_n->min_name, mname);
new_did_n->min_namlen = (ushort_t)min_len;
} else {