Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Oct 2017 08:10:54 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324345 - head/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201710060810.v968Aslg041082@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Oct  6 08:10:54 2017
New Revision: 324345
URL: https://svnweb.freebsd.org/changeset/base/324345

Log:
  MFV r316877: 7571 non-present readonly numeric ZFS props do not have default value
  
  illumos/illumos-gate@ad2760acbd9c3b479bf632f05c6f03d89830799d
  https://github.com/illumos/illumos-gate/commit/ad2760acbd9c3b479bf632f05c6f03d89830799d
  
  https://www.illumos.org/issues/7571
    ZFS displays the default value for non-present readonly numeric (and index)
    properties. However, these properties default values are not meaningful.
    Instead, we should display a "-", indicating that they are not present. For
    example, on a version-12 pool, the usedby* properties are not available, but
    they show up as the incorrect value "0":
       1. zfs get all test12
          ...
          test12 usedbysnapshots 0 -
          test12 usedbydataset 0 -
          test12 usedbychildren 0 -
          test12 usedbyrefreservation 0 -
    We will be introducing more sometimes-present numeric readonly properties, so
    it would be nice to fix this.
  
  Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
  Reviewed by: George Wilson <george.wilson@delphix.com>
  Approved by: Robert Mustacchi <rm@joyent.com>
  Author: Matthew Ahrens <mahrens@delphix.com>
  
  MFC after:	3 weeks

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Fri Oct  6 08:09:20 2017	(r324344)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Fri Oct  6 08:10:54 2017	(r324345)
@@ -22,7 +22,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
  * Copyright (c) 2012 DEY Storage Systems, Inc.  All rights reserved.
  * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved.
  * Copyright (c) 2013 Martin Matuska. All rights reserved.
@@ -2166,6 +2166,7 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t pro
 			if (zfs_prop_readonly(prop) &&
 			    *source != NULL && (*source)[0] == '\0') {
 				*source = NULL;
+				return (-1);
 			}
 			break;
 



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