From d1724b59dc52041fbe66c8db616d8f8e777d5b92 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sat, 7 Dec 2024 13:20:20 +1100 Subject: [PATCH] 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 Reviewed-by: Alexander Motin Reviewed-by: Pavel Snajdr Signed-off-by: Rob Norris Closes #17377 --- module/icp/algs/aes/aes_impl.c | 2 -- module/icp/algs/modes/gcm.c | 2 -- module/zfs/vdev_raidz_math.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/module/icp/algs/aes/aes_impl.c b/module/icp/algs/aes/aes_impl.c index 3c17c366f..b652c8c72 100644 --- a/module/icp/algs/aes/aes_impl.c +++ b/module/icp/algs/aes/aes_impl.c @@ -420,8 +420,6 @@ icp_aes_impl_get(char *buffer, zfs_kernel_param_t *kp) char *fmt; const uint32_t impl = AES_IMPL_READ(icp_aes_impl); - ASSERT(aes_impl_initialized); - /* list mandatory options */ for (i = 0; i < ARRAY_SIZE(aes_impl_opts); i++) { fmt = (impl == aes_impl_opts[i].sel) ? "[%s] " : "%s "; diff --git a/module/icp/algs/modes/gcm.c b/module/icp/algs/modes/gcm.c index 953afd885..c2a982b5a 100644 --- a/module/icp/algs/modes/gcm.c +++ b/module/icp/algs/modes/gcm.c @@ -948,8 +948,6 @@ icp_gcm_impl_get(char *buffer, zfs_kernel_param_t *kp) char *fmt; const uint32_t impl = GCM_IMPL_READ(icp_gcm_impl); - ASSERT(gcm_impl_initialized); - /* list mandatory options */ for (i = 0; i < ARRAY_SIZE(gcm_impl_opts); i++) { #ifdef CAN_USE_GCM_ASM diff --git a/module/zfs/vdev_raidz_math.c b/module/zfs/vdev_raidz_math.c index 0cd1cb0a5..bdc159d8e 100644 --- a/module/zfs/vdev_raidz_math.c +++ b/module/zfs/vdev_raidz_math.c @@ -643,8 +643,6 @@ vdev_raidz_impl_get(char *buffer, size_t size) char *fmt; const uint32_t impl = RAIDZ_IMPL_READ(zfs_vdev_raidz_impl); - ASSERT(raidz_math_initialized); - /* list mandatory options */ for (i = 0; i < ARRAY_SIZE(math_impl_opts) - 2; i++) { fmt = (impl == math_impl_opts[i].sel) ? "[%s] " : "%s ";