diff options
author | Hajo Möller <[email protected]> | 2016-01-05 22:46:54 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-08-30 15:57:15 -0700 |
commit | 82ab6848ccff8fa42da56a2b5c74c767f8ad8fb0 (patch) | |
tree | abc64a8aa9a0f856e4b63c67145b09c98a86a504 /module/zfs/spa.c | |
parent | 8fe453b6718c089fdd248f45fd0adee26bd42b66 (diff) |
Fix "zpool get guid,freeing,leaked" source
`zpool get guid,freeing,leaked` shows SOURCE as `default`, it should
be `-` as those props are not editable.
Changed code to not overwrite `src` for `ZPOOL_PROP_VERSION`, so it
stays `ZPROP_SRC_NONE`. Make src const to avoid future mistakes
Signed-off-by: Hajo Möller <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4170
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r-- | module/zfs/spa.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 3b63427c2..374322a03 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -200,7 +200,7 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp) vdev_t *rvd = spa->spa_root_vdev; dsl_pool_t *pool = spa->spa_dsl_pool; uint64_t size, alloc, cap, version; - zprop_source_t src = ZPROP_SRC_NONE; + const zprop_source_t src = ZPROP_SRC_NONE; spa_config_dirent_t *dp; metaslab_class_t *mc = spa_normal_class(spa); @@ -232,11 +232,13 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp) rvd->vdev_state, src); version = spa_version(spa); - if (version == zpool_prop_default_numeric(ZPOOL_PROP_VERSION)) - src = ZPROP_SRC_DEFAULT; - else - src = ZPROP_SRC_LOCAL; - spa_prop_add_list(*nvp, ZPOOL_PROP_VERSION, NULL, version, src); + if (version == zpool_prop_default_numeric(ZPOOL_PROP_VERSION)) { + spa_prop_add_list(*nvp, ZPOOL_PROP_VERSION, NULL, + version, ZPROP_SRC_DEFAULT); + } else { + spa_prop_add_list(*nvp, ZPOOL_PROP_VERSION, NULL, + version, ZPROP_SRC_LOCAL); + } } if (pool != NULL) { |