diff options
author | mmusante <none@none> | 2007-01-22 11:43:32 -0800 |
---|---|---|
committer | mmusante <none@none> | 2007-01-22 11:43:32 -0800 |
commit | a75573b66592c10a94e4d9e4172408cc183a84c1 (patch) | |
tree | c2abd4422ac2bc90226a3013c7f17c405dec6af0 /usr/src | |
parent | d58459f4b19c5a2644c36745685ba4cd45418287 (diff) | |
download | illumos-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.c | 6 |
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); } /* |