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.kim...@delphix.com>
  Reviewed by: George Wilson <george.wil...@delphix.com>
  Approved by: Robert Mustacchi <r...@joyent.com>
  Author: Matthew Ahrens <mahr...@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;
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to