mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
zhack: Add 'feature enable' force option
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. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #3878
This commit is contained in:
parent
8302528617
commit
ebecfcd699
@ -357,8 +357,10 @@ zhack_do_feature_enable(int argc, char **argv)
|
|||||||
zhack_spa_open(target, B_FALSE, FTAG, &spa);
|
zhack_spa_open(target, B_FALSE, FTAG, &spa);
|
||||||
mos = spa->spa_meta_objset;
|
mos = spa->spa_meta_objset;
|
||||||
|
|
||||||
if (zfeature_is_supported(feature.fi_guid))
|
if (zfeature_is_supported(feature.fi_guid) && (g_force == B_FALSE))
|
||||||
fatal(spa, FTAG, "'%s' is a real feature, will not enable");
|
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))
|
if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
|
||||||
fatal(spa, FTAG, "feature already enabled: %s",
|
fatal(spa, FTAG, "feature already enabled: %s",
|
||||||
feature.fi_guid);
|
feature.fi_guid);
|
||||||
|
Loading…
Reference in New Issue
Block a user