module: zcommon: zprop: common: zprop_width: namespace exceptions

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 <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13125
This commit is contained in:
наб 2022-02-20 02:58:09 +01:00 committed by Brian Behlendorf
parent 6d8a00ff1f
commit a9a89755fa
1 changed files with 6 additions and 2 deletions

View File

@ -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++) {