summaryrefslogtreecommitdiff
path: root/usr/src/cmd/zpool/zpool_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/zpool/zpool_main.c')
-rw-r--r--usr/src/cmd/zpool/zpool_main.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c
index 31ce0c7e11..cb13102874 100644
--- a/usr/src/cmd/zpool/zpool_main.c
+++ b/usr/src/cmd/zpool/zpool_main.c
@@ -1082,6 +1082,7 @@ errout:
* '/<pool>'
* -t Use the temporary name until the pool is exported.
* -o Set property=value.
+ * -o Set feature@feature=enabled|disabled.
* -d Don't automatically enable all supported pool features
* (individual features can be enabled with -o).
* -O Set fsproperty=value in the pool's root file system
@@ -1415,22 +1416,26 @@ zpool_do_create(int argc, char **argv)
/*
* Hand off to libzfs.
*/
- if (enable_all_pool_feat) {
- spa_feature_t i;
- for (i = 0; i < SPA_FEATURES; i++) {
- char propname[MAXPATHLEN];
- zfeature_info_t *feat = &spa_feature_table[i];
- (void) snprintf(propname, sizeof (propname),
- "feature@%s", feat->fi_uname);
-
- /*
- * Skip feature if user specified it manually
- * on the command line.
- */
- if (nvlist_exists(props, propname))
- continue;
+ spa_feature_t i;
+ for (i = 0; i < SPA_FEATURES; i++) {
+ char propname[MAXPATHLEN];
+ char *propval;
+ zfeature_info_t *feat = &spa_feature_table[i];
+ (void) snprintf(propname, sizeof (propname),
+ "feature@%s", feat->fi_uname);
+ /*
+ * Only features contained in props will be enabled:
+ * remove from the nvlist every ZFS_FEATURE_DISABLED
+ * value and add every missing ZFS_FEATURE_ENABLED if
+ * enable_all_pool_feat is set.
+ */
+ if (!nvlist_lookup_string(props, propname, &propval)) {
+ if (strcmp(propval, ZFS_FEATURE_DISABLED) == 0)
+ (void) nvlist_remove_all(props,
+ propname);
+ } else if (enable_all_pool_feat) {
ret = add_prop_list(propname,
ZFS_FEATURE_ENABLED, &props, B_TRUE);
if (ret != 0)
@@ -3411,20 +3416,20 @@ print_iostat_labels(iostat_cbdata_t *cb, unsigned int force_column_width,
/*
* Utility function to print out a line of dashes like:
*
- * -------------------------------- ----- ----- ----- ----- -----
+ * -------------------------------- ----- ----- ----- ----- -----
*
* ...or a dashed named-row line like:
*
- * logs - - - - -
+ * logs - - - - -
*
* @cb: iostat data
*
* @force_column_width If non-zero, use the value as the column width.
- * Otherwise use the default column widths.
+ * Otherwise use the default column widths.
*
* @name: Print a dashed named-row line starting
- * with @name. Otherwise, print a regular
- * dashed line.
+ * with @name. Otherwise, print a regular
+ * dashed line.
*/
static void
print_iostat_dashes(iostat_cbdata_t *cb, unsigned int force_column_width,