mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-12 19:20:28 +03:00
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 <dasjoe@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #4170
This commit is contained in:
parent
8fe453b671
commit
82ab6848cc
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user