From a9a89755faa7cff2a7e7779986ac18fcfabfd3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 20 Feb 2022 02:58:09 +0100 Subject: [PATCH] module: zcommon: zprop: common: zprop_width: namespace exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this, /all/ numerical properties 1 (ZFS_PROP_CREATION, ZPOOL_PROP_SIZE, VDEV_PROP_CAPACITY) would be non-fixed and /all/ numerical properties 5 (ZFS_PROP_COMPRESSRATIO, ZPOOL_PROP_HEALTH, VDEV_PROP_PSIZE) would be 8-wide Realistically, this doesn't appear to be much of a problem Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13125 --- module/zcommon/zprop_common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module/zcommon/zprop_common.c b/module/zcommon/zprop_common.c index c32039c1b6..d7a3ff6082 100644 --- a/module/zcommon/zprop_common.c +++ b/module/zcommon/zprop_common.c @@ -437,6 +437,9 @@ zprop_width(int prop, boolean_t *fixed, zfs_type_t type) prop_tbl = zprop_get_proptable(type); pd = &prop_tbl[prop]; + if (type != ZFS_TYPE_POOL && type != ZFS_TYPE_VDEV) + type = ZFS_TYPE_FILESYSTEM; + *fixed = B_TRUE; /* @@ -460,15 +463,16 @@ zprop_width(int prop, boolean_t *fixed, zfs_type_t type) * 'creation' is handled specially because it's a number * internally, but displayed as a date string. */ - if (prop == ZFS_PROP_CREATION) + if (type == ZFS_TYPE_FILESYSTEM && prop == ZFS_PROP_CREATION) *fixed = B_FALSE; /* * 'health' is handled specially because it's a number * internally, but displayed as a fixed 8 character string. */ - if (prop == ZPOOL_PROP_HEALTH) + if (type == ZFS_TYPE_POOL && prop == ZPOOL_PROP_HEALTH) ret = 8; break; + case PROP_TYPE_INDEX: idx = prop_tbl[prop].pd_table; for (i = 0; idx[i].pi_name != NULL; i++) {