From 663207adb1669640c01c5ec6949ce78fd806efae Mon Sep 17 00:00:00 2001 From: Don Brady Date: Fri, 12 Apr 2019 15:10:57 +0000 Subject: 10601 Pool allocation classes 10757 Add -gLp to zpool subcommands for alt vdev names Portions contributed by: Jerry Jelinek Portions contributed by: HÃ¥kan Johansson Portions contributed by: Richard Yao Portions contributed by: Chunwei Chen Portions contributed by: loli10K Reviewed by: Pavel Zakharov Reviewed by: Richard Laager Reviewed by: Alek Pinchuk Reviewed by: Andreas Dilger Reviewed by: DHE Reviewed by: Richard Elling Reviewed by: Gregor Kopka Reviewed by: Kash Pande Reviewed by: Brian Behlendorf Reviewed by: Tony Hutter Reviewed by: George Melikov Reviewed by: Giuseppe Di Natale Reviewed by: bunder2015 Reviewed by: Matthew Ahrens Reviewed by: Igor Kozhukhov Reviewed by: Kody Kantor Approved by: Dan McDonald MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/src/lib/libzfs/common/libzfs_dataset.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'usr/src/lib/libzfs/common/libzfs_dataset.c') diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c index f27322b694..662e207eea 100644 --- a/usr/src/lib/libzfs/common/libzfs_dataset.c +++ b/usr/src/lib/libzfs/common/libzfs_dataset.c @@ -1173,6 +1173,36 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, } break; } + + case ZFS_PROP_SPECIAL_SMALL_BLOCKS: + if (zpool_hdl != NULL) { + char state[64] = ""; + + /* + * Issue a warning but do not fail so that + * tests for setable properties succeed. + */ + if (zpool_prop_get_feature(zpool_hdl, + "feature@allocation_classes", state, + sizeof (state)) != 0 || + strcmp(state, ZFS_FEATURE_ACTIVE) != 0) { + (void) fprintf(stderr, gettext( + "%s: property requires a special " + "device in the pool\n"), propname); + } + } + if (intval != 0 && + (intval < SPA_MINBLOCKSIZE || + intval > SPA_OLD_MAXBLOCKSIZE || !ISP2(intval))) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "invalid '%s=%d' property: must be zero or " + "a power of 2 from 512B to 128K"), propname, + intval); + (void) zfs_error(hdl, EZFS_BADPROP, errbuf); + goto error; + } + break; + case ZFS_PROP_MLSLABEL: { /* -- cgit v1.2.3