diff options
author | mm <mm@FreeBSD.org> | 2010-05-23 21:02:43 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2010-05-23 21:02:43 +0000 |
commit | 9b8a28a2fd714c704ecbfb5af5b8bdd620a83e3c (patch) | |
tree | d5a87fcc9d055d9d56bed88698efc85bb67ea3b8 /cddl/contrib/opensolaris/lib/libzfs/common | |
parent | 0741f43d5e5defdd320755fa68cdb9669ac13b32 (diff) | |
download | FreeBSD-src-9b8a28a2fd714c704ecbfb5af5b8bdd620a83e3c.zip FreeBSD-src-9b8a28a2fd714c704ecbfb5af5b8bdd620a83e3c.tar.gz |
Fix zfs receive temporarily changing unchanged stream properties.
Fix possible panic with zfs_enable_datasets.
OpenSolaris onnv revision: 8536:33bd5de3260e
Approved by: pjd, delphij (mentor)
Obtained from: OpenSolaris (Bug ID 6748561, 6757075)
MFC after: 3 days
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c index 76ab7ac..ea8523d 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1209,10 +1209,12 @@ zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int flags) /* * And mount all the datasets, keeping track of which ones - * succeeded or failed. By using zfs_alloc(), the good pointer - * will always be non-NULL. + * succeeded or failed. */ - good = zfs_alloc(zhp->zpool_hdl, cb.cb_used * sizeof (int)); + if ((good = zfs_alloc(zhp->zpool_hdl, + cb.cb_used * sizeof (int))) == NULL) + goto out; + ret = 0; for (i = 0; i < cb.cb_used; i++) { if (zfs_mount(cb.cb_datasets[i], mntopts, flags) != 0) |