Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2018 23:50:43 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331391 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201803222350.w2MNoh3r096551@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Mar 22 23:50:43 2018
New Revision: 331391
URL: https://svnweb.freebsd.org/changeset/base/331391

Log:
  MFC r329664: MFV r316893:
  7604 if volblocksize property is the default, it displays as "-" rather than 8K
  
  illumos/illumos-gate@4d86c0eab246bdfddc2dd52410ba808433bd6266
  https://github.com/illumos/illumos-gate/commit/4d86c0eab246bdfddc2dd52410ba808433bd6266
  
  https://www.illumos.org/issues/7604
    If a zvol has the default setting for the "volblocksize" property, it is
    8KB. However, it is displayed as "-" (not present), rather than "8K".
    The problem was introduced by:
    commit 25228e830e86924a41243343b1de9daf2d7dd43a
        Author: Matthew Ahrens &lt;mahrens@delphix.com&gt;
        Date:   Thu Nov 17 14:37:24 2016 -0800
    7571 non-present readonly numeric ZFS props do not have default value
    which changed changed get_numeric_property() to indicate that readonly
    default properties are not present. However, zfs_prop_readonly() returns
    TRUE for both readonly and set-once properties (e.g. volblocksize).
    Amusingly, that commit essentially reverted:
    6900484 default volblocksize is no longer being reported correctly
    from November 2009. However, that change was not correct either; the
    correct solution is to only do this check for "truly readonly" (i.e. not
    setonce) properties.
    $ zfs list -t volume -o name,volblocksize
        NAME
    VOLBLOCK
        domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
    archive            -
        domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
    datafile           -
        domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
    external           -
        rpool/dump
    128K
        rpool/swap
    4K
        rpool/swap1
    ===============================================================================
  
  Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
  Reviewed by: Paul Dagnelie <pcd@delphix.com>
  Reviewed by: John Kennedy <john.kennedy@delphix.com>
  Reviewed by: George Wilson <george.wilson@delphix.com>
  Approved by: Robert Mustacchi <rm@joyent.com>
  Author: Matthew Ahrens <mahrens@delphix.com>

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

Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Thu Mar 22 23:49:54 2018	(r331390)
+++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Thu Mar 22 23:50:43 2018	(r331391)
@@ -2161,9 +2161,12 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t pro
 			/*
 			 * If we tried to use a default value for a
 			 * readonly property, it means that it was not
-			 * present.
+			 * present.  Note this only applies to "truly"
+			 * readonly properties, not set-once properties
+			 * like volblocksize.
 			 */
 			if (zfs_prop_readonly(prop) &&
+			    !zfs_prop_setonce(prop) &&
 			    *source != NULL && (*source)[0] == '\0') {
 				*source = NULL;
 				return (-1);



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