diff options
author | gaurkuma <[email protected]> | 2017-08-11 08:56:24 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-08-11 08:56:24 -0700 |
commit | 761b8ec6bf98f39550353173ad7bec5306073f9c (patch) | |
tree | 75308c5341691961a0cc69f58199852fef406212 /module/icp/spi | |
parent | c25b8f99f8dcbe898b81728e6a9dab107df4fc0b (diff) |
Allow longer SPA names in stats
The pool name can be 256 chars long. Today, in /proc/spl/kstat/zfs/
the name is limited to < 32 characters. This change is to allows
bigger pool names.
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: loli10K <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: gaurkuma <[email protected]>
Closes #6481
Diffstat (limited to 'module/icp/spi')
-rw-r--r-- | module/icp/spi/kcf_spi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/module/icp/spi/kcf_spi.c b/module/icp/spi/kcf_spi.c index c2c2b54bc..0a6e38df8 100644 --- a/module/icp/spi/kcf_spi.c +++ b/module/icp/spi/kcf_spi.c @@ -111,7 +111,7 @@ int crypto_register_provider(crypto_provider_info_t *info, crypto_kcf_provider_handle_t *handle) { - char ks_name[KSTAT_STRLEN]; + char *ks_name; kcf_provider_desc_t *prov_desc = NULL; int ret = CRYPTO_ARGUMENTS_BAD; @@ -238,12 +238,12 @@ crypto_register_provider(crypto_provider_info_t *info, * This kstat is deleted, when the provider unregisters. */ if (prov_desc->pd_prov_type == CRYPTO_SW_PROVIDER) { - (void) snprintf(ks_name, KSTAT_STRLEN, "%s_%s", + ks_name = kmem_asprintf("%s_%s", "NONAME", "provider_stats"); } else { - (void) snprintf(ks_name, KSTAT_STRLEN, "%s_%d_%u_%s", - "NONAME", 0, - prov_desc->pd_prov_id, "provider_stats"); + ks_name = kmem_asprintf("%s_%d_%u_%s", + "NONAME", 0, prov_desc->pd_prov_id, + "provider_stats"); } prov_desc->pd_kstat = kstat_create("kcf", 0, ks_name, "crypto", @@ -261,6 +261,7 @@ crypto_register_provider(crypto_provider_info_t *info, prov_desc->pd_kstat->ks_update = kcf_prov_kstat_update; kstat_install(prov_desc->pd_kstat); } + strfree(ks_name); } if (prov_desc->pd_prov_type == CRYPTO_HW_PROVIDER) |