Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 2015 10:44:39 +0000 (UTC)
From:      Steven Hartland <smh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r277239 - head/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201501161044.t0GAieGv086235@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: smh
Date: Fri Jan 16 10:44:39 2015
New Revision: 277239
URL: https://svnweb.freebsd.org/changeset/base/277239

Log:
  Eliminate illumos whole disk special case when searching for a ZFS vdev
  
  This special case prevented locating vdevs which start with c[0-9] e.g.
  gptid/c6cde092-504b-11e4-ba52-c45444453598 hence it was impossible to
  online a vdev via its path.
  
  Submitted by:	Peter Xu <xzpeter@gmail.com>
  MFC after:	2 weeks
  Sponsored by:	Multiplay

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Fri Jan 16 10:09:28 2015	(r277238)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Fri Jan 16 10:44:39 2015	(r277239)
@@ -1916,6 +1916,7 @@ zpool_scan(zpool_handle_t *zhp, pool_sca
 	}
 }
 
+#ifdef illumos
 /*
  * This provides a very minimal check whether a given string is likely a
  * c#t#d# style string.  Users of this are expected to do their own
@@ -1947,6 +1948,7 @@ ctd_check_path(char *str) {
 	}
 	return (CTD_CHECK(str));
 }
+#endif
 
 /*
  * Find a vdev that matches the search criteria specified. We use the
@@ -2002,6 +2004,7 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist
 		 *
 		 * Otherwise, all other searches are simple string compares.
 		 */
+#ifdef illumos
 		if (strcmp(srchkey, ZPOOL_CONFIG_PATH) == 0 &&
 		    ctd_check_path(val)) {
 			uint64_t wholedisk = 0;
@@ -2041,6 +2044,9 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist
 				break;
 			}
 		} else if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0 && val) {
+#else
+		if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0 && val) {
+#endif
 			char *type, *idx, *end, *p;
 			uint64_t id, vdev_id;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501161044.t0GAieGv086235>