summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authormmusante <none@none>2007-01-22 11:43:32 -0800
committermmusante <none@none>2007-01-22 11:43:32 -0800
commita75573b66592c10a94e4d9e4172408cc183a84c1 (patch)
treec2abd4422ac2bc90226a3013c7f17c405dec6af0 /usr/src
parentd58459f4b19c5a2644c36745685ba4cd45418287 (diff)
downloadillumos-gate-a75573b66592c10a94e4d9e4172408cc183a84c1.tar.gz
6497211 Creating a zpool mirror with a large number of devices will core dump
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/fs/zfs/vdev_label.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/zfs/vdev_label.c b/usr/src/uts/common/fs/zfs/vdev_label.c
index 8d8cb6f7af..9d9f5556fa 100644
--- a/usr/src/uts/common/fs/zfs/vdev_label.c
+++ b/usr/src/uts/common/fs/zfs/vdev_label.c
@@ -547,10 +547,12 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason)
buf = vp->vp_nvlist;
buflen = sizeof (vp->vp_nvlist);
- if (nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_SLEEP) != 0) {
+ error = nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_SLEEP);
+ if (error != 0) {
nvlist_free(label);
zio_buf_free(vp, sizeof (vdev_phys_t));
- return (EINVAL);
+ /* EFAULT means nvlist_pack ran out of room */
+ return (error == EFAULT ? ENAMETOOLONG : EINVAL);
}
/*