Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 2018 04:48:14 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r328251 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/sys/fs vendor/illumos/dist/cmd/zpool vendor/illumos/dist/lib/libzfs/common
Message-ID:  <201801220448.w0M4mEjB033773@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Jan 22 04:48:14 2018
New Revision: 328251
URL: https://svnweb.freebsd.org/changeset/base/328251

Log:
  8652 Tautological comparisons with ZPROP_INVAL
  
  illumos/illumos-gate@4ae5f5f06c6c2d1db8167480f7d9e3b5378ba2f2
  
  https://www.illumos.org/issues/8652:
  Clang and GCC prefer to use unsigned ints to store enums. With Clang, that
  causes tautological comparison warnings when comparing a zfs_prop_t or
  zpool_prop_t variable to the macro ZPROP_INVAL. It's likely that error
  handling code is being silently removed as a result.
  
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Reviewed by: Igor Kozhukhov <igor@dilos.org>
  Approved by: Gordon Ross <gwr@nexenta.com>
  Author: Alan Somers <asomers@gmail.com>

Modified:
  vendor/illumos/dist/cmd/zpool/zpool_main.c
  vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c

Changes in other areas also in this revision:
Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c
  vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h

Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c
==============================================================================
--- vendor/illumos/dist/cmd/zpool/zpool_main.c	Mon Jan 22 04:37:04 2018	(r328250)
+++ vendor/illumos/dist/cmd/zpool/zpool_main.c	Mon Jan 22 04:48:14 2018	(r328251)
@@ -440,7 +440,7 @@ add_prop_list(const char *propname, char *propval, nvl
 		 * feature@ properties and version should not be specified
 		 * at the same time.
 		 */
-		if ((prop == ZPROP_INVAL && zpool_prop_feature(propname) &&
+		if ((prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname) &&
 		    nvlist_exists(proplist, vname)) ||
 		    (prop == ZPOOL_PROP_VERSION &&
 		    prop_list_contains_feature(proplist))) {

Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c	Mon Jan 22 04:37:04 2018	(r328250)
+++ vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c	Mon Jan 22 04:48:14 2018	(r328251)
@@ -445,7 +445,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char 
 		const char *propname = nvpair_name(elem);
 
 		prop = zpool_name_to_prop(propname);
-		if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) {
+		if (prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname)) {
 			int err;
 			char *fname = strchr(propname, '@') + 1;
 
@@ -484,7 +484,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char 
 		/*
 		 * Make sure this property is valid and applies to this type.
 		 */
-		if (prop == ZPROP_INVAL) {
+		if (prop == ZPOOL_PROP_INVAL) {
 			zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
 			    "invalid property '%s'"), propname);
 			(void) zfs_error(hdl, EZFS_BADPROP, errbuf);



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