Print this page
zpool import is braindead

@@ -25,10 +25,11 @@
  * Copyright (c) 2013 by Delphix. All rights reserved.
  * Copyright (c) 2012 DEY Storage Systems, Inc.  All rights reserved.
  * Copyright (c) 2013 Martin Matuska. All rights reserved.
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2014 RackTop Systems.
  */
 
 #include <ctype.h>
 #include <errno.h>
 #include <libintl.h>

@@ -1483,11 +1484,11 @@
         char errbuf[1024];
         libzfs_handle_t *hdl = zhp->zfs_hdl;
         nvlist_t *nvl = NULL, *realprops;
         zfs_prop_t prop;
         boolean_t do_prefix = B_TRUE;
-        int added_resv;
+        int added_resv = 0;
 
         (void) snprintf(errbuf, sizeof (errbuf),
             dgettext(TEXT_DOMAIN, "cannot set property for '%s'"),
             zhp->zfs_name);
 

@@ -3003,11 +3004,11 @@
 int
 zfs_create_ancestors(libzfs_handle_t *hdl, const char *path)
 {
         int prefix;
         char *path_copy;
-        int rc;
+        int rc = 0;
 
         if (check_parents(hdl, path, NULL, B_TRUE, &prefix) != 0)
                 return (-1);
 
         if ((path_copy = strdup(path)) != NULL) {

@@ -3625,11 +3626,11 @@
 zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force)
 {
         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 ||
             zhp->zfs_type == ZFS_TYPE_VOLUME);
 

@@ -3697,11 +3698,11 @@
  */
 int
 zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive,
     boolean_t force_unmount)
 {
-        int ret;
+        int ret = -1;
         zfs_cmd_t zc = { 0 };
         char *delim;
         prop_changelist_t *cl = NULL;
         zfs_handle_t *zhrp = NULL;
         char *parentname = NULL;