svn commit: r305206 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common

Alexander Motin mav at FreeBSD.org
Thu Sep 1 14:53:58 UTC 2016


Author: mav
Date: Thu Sep  1 14:53:56 2016
New Revision: 305206
URL: https://svnweb.freebsd.org/changeset/base/305206

Log:
  MFV r302658: 6872 zfs libraries should not allow uninitialized variables
  
  illumos/illumos-gate at f83b46baf98d276f5f84fa84c8b461f412ac1f5e
  https://github.com/illumos/illumos-gate/commit/f83b46baf98d276f5f84fa84c8b461f41
  2ac1f5e
  
  https://www.illumos.org/issues/6872
    We compile the zfs libraries with -Wno-uninitialized. We should remove
    this. Change makefiles, fix new warnings, fix pbchk errors.
  
  Reviewed by: Dan Kimmel <dan.kimmel at delphix.com>
  Reviewed by: George Wilson <george.wilson at delphix.com>
  Reviewed by: Prakash Surya <prakash.surya at delphix.com>
  Reviewed by: Yuri Pankov <yuri.pankov at nexenta.com>
  Approved by: Robert Mustacchi <rm at joyent.com>
  Author: Paul Dagnelie <pcd at delphix.com>

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c	Thu Sep  1 14:52:05 2016	(r305205)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c	Thu Sep  1 14:53:56 2016	(r305206)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, 2015 by Delphix. All rights reserved.
  * Copyright 2016 Igor Kozhukhov <ikozhukhov at gmail.com>.
  */
 
@@ -597,7 +597,6 @@ get_replication(nvlist_t *nvroot, boolea
 	verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
 	    &top, &toplevels) == 0);
 
-	lastrep.zprl_type = NULL;
 	for (t = 0; t < toplevels; t++) {
 		uint64_t is_log = B_FALSE;
 

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Thu Sep  1 14:52:05 2016	(r305205)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Thu Sep  1 14:53:56 2016	(r305206)
@@ -1584,7 +1584,7 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl
 	libzfs_handle_t *hdl = zhp->zfs_hdl;
 	nvlist_t *nvl;
 	int nvl_len;
-	int added_resv;
+	int added_resv = 0;
 
 	(void) snprintf(errbuf, sizeof (errbuf),
 	    dgettext(TEXT_DOMAIN, "cannot set property for '%s'"),
@@ -3212,7 +3212,7 @@ zfs_create_ancestors(libzfs_handle_t *hd
 {
 	int prefix;
 	char *path_copy;
-	int rc;
+	int rc = 0;
 
 	if (check_parents(hdl, path, NULL, B_TRUE, &prefix) != 0)
 		return (-1);
@@ -3854,7 +3854,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_hand
 	rollback_data_t cb = { 0 };
 	int err;
 	boolean_t restore_resv = 0;
-	uint64_t old_volsize, new_volsize;
+	uint64_t old_volsize = 0, new_volsize;
 	zfs_prop_t resv_prop;
 
 	assert(zhp->zfs_type == ZFS_TYPE_FILESYSTEM ||
@@ -4071,6 +4071,7 @@ zfs_rename(zfs_handle_t *zhp, const char
 			    "child dataset with inherited mountpoint is used "
 			    "in a non-global zone"));
 			(void) zfs_error(hdl, EZFS_ZONED, errbuf);
+			ret = -1;
 			goto error;
 		}
 

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Thu Sep  1 14:52:05 2016	(r305205)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Thu Sep  1 14:53:56 2016	(r305206)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
  * Copyright 2015 RackTop Systems.
  * Copyright 2016 Nexenta Systems, Inc.
  */
@@ -440,12 +440,12 @@ get_configs(libzfs_handle_t *hdl, pool_l
 	pool_entry_t *pe;
 	vdev_entry_t *ve;
 	config_entry_t *ce;
-	nvlist_t *ret = NULL, *config = NULL, *tmp, *nvtop, *nvroot;
+	nvlist_t *ret = NULL, *config = NULL, *tmp = NULL, *nvtop, *nvroot;
 	nvlist_t **spares, **l2cache;
 	uint_t i, nspares, nl2cache;
 	boolean_t config_seen;
 	uint64_t best_txg;
-	char *name, *hostname;
+	char *name, *hostname = NULL;
 	uint64_t guid;
 	uint_t children = 0;
 	nvlist_t **child = NULL;

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c	Thu Sep  1 14:52:05 2016	(r305205)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c	Thu Sep  1 14:53:56 2016	(r305206)
@@ -1010,7 +1010,7 @@ zprop_print_one_property(const char *nam
     const char *source, const char *recvd_value)
 {
 	int i;
-	const char *str;
+	const char *str = NULL;
 	char buf[128];
 
 	/*


More information about the svn-src-all mailing list