Skip to content

Commit

Permalink
Add 'zhack feature enable' force option
Browse files Browse the repository at this point in the history
Add a force option to allow zhack to add features which are
part of the known set of supported features.  By default
this is disabled.
  • Loading branch information
behlendorf committed Nov 18, 2015
1 parent cb6a4a0 commit 67ab133
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/zhack/zhack.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,10 @@ zhack_do_feature_enable(int argc, char **argv)
zhack_spa_open(target, B_FALSE, FTAG, &spa);
mos = spa->spa_meta_objset;

if (zfeature_is_supported(feature.fi_guid))
fatal(spa, FTAG, "'%s' is a real feature, will not enable");
if (zfeature_is_supported(feature.fi_guid) && (g_force == B_FALSE))
fatal(spa, FTAG,
"'%s' is a real feature, will not enable\n"
"provide the -f option to force override", feature.fi_guid);
if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
fatal(spa, FTAG, "feature already enabled: %s",
feature.fi_guid);
Expand Down

0 comments on commit 67ab133

Please sign in to comment.