Linux 6.5 compat: spl: properly unregister sysctl entries
commitcacc599aa20b6aba0ac8173386cea2f8b435068e
authorAndrea Righi <andrea.righi@canonical.com>
Thu, 7 Sep 2023 21:36:32 +0000 (7 23:36 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 19 Sep 2023 15:50:01 +0000 (19 08:50 -0700)
tree03e884f1a5d1a5f7d40ab79960fb67403309142a
parentc7ee59a160f74049de1e459b3c3c63671784703f
Linux 6.5 compat: spl: properly unregister sysctl entries

When register_sysctl_table() is unavailable we fail to properly
unregister sysctl entries under "kernel/spl".

This leads to errors like the following when spl is unloaded/reloaded,
making impossible to properly reload the spl module:

[  746.995704] sysctl duplicate entry: /kernel/spl/kmem/slab_kvmem_total

Fix by cleaning up all the sub-entries inside "kernel/spl" when the
spl module is unloaded.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Closes #15239
module/os/linux/spl/spl-proc.c