tunables: don't assert initialisation in impl getters

It actually doesn't matter if it's not initialised when we first query
the current value; it just returns empty-string. A crash is quite
obnoxious even if it is a rare case.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Pavel Snajdr <snajpa@snajpa.net>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #17377
This commit is contained in:
Rob Norris 2024-12-07 13:20:20 +11:00 committed by Brian Behlendorf
parent 5ef91c2bee
commit d1724b59dc
3 changed files with 0 additions and 6 deletions

View File

@ -420,8 +420,6 @@ icp_aes_impl_get(char *buffer, zfs_kernel_param_t *kp)
char *fmt; char *fmt;
const uint32_t impl = AES_IMPL_READ(icp_aes_impl); const uint32_t impl = AES_IMPL_READ(icp_aes_impl);
ASSERT(aes_impl_initialized);
/* list mandatory options */ /* list mandatory options */
for (i = 0; i < ARRAY_SIZE(aes_impl_opts); i++) { for (i = 0; i < ARRAY_SIZE(aes_impl_opts); i++) {
fmt = (impl == aes_impl_opts[i].sel) ? "[%s] " : "%s "; fmt = (impl == aes_impl_opts[i].sel) ? "[%s] " : "%s ";

View File

@ -948,8 +948,6 @@ icp_gcm_impl_get(char *buffer, zfs_kernel_param_t *kp)
char *fmt; char *fmt;
const uint32_t impl = GCM_IMPL_READ(icp_gcm_impl); const uint32_t impl = GCM_IMPL_READ(icp_gcm_impl);
ASSERT(gcm_impl_initialized);
/* list mandatory options */ /* list mandatory options */
for (i = 0; i < ARRAY_SIZE(gcm_impl_opts); i++) { for (i = 0; i < ARRAY_SIZE(gcm_impl_opts); i++) {
#ifdef CAN_USE_GCM_ASM #ifdef CAN_USE_GCM_ASM

View File

@ -643,8 +643,6 @@ vdev_raidz_impl_get(char *buffer, size_t size)
char *fmt; char *fmt;
const uint32_t impl = RAIDZ_IMPL_READ(zfs_vdev_raidz_impl); const uint32_t impl = RAIDZ_IMPL_READ(zfs_vdev_raidz_impl);
ASSERT(raidz_math_initialized);
/* list mandatory options */ /* list mandatory options */
for (i = 0; i < ARRAY_SIZE(math_impl_opts) - 2; i++) { for (i = 0; i < ARRAY_SIZE(math_impl_opts) - 2; i++) {
fmt = (impl == math_impl_opts[i].sel) ? "[%s] " : "%s "; fmt = (impl == math_impl_opts[i].sel) ? "[%s] " : "%s ";