Linux 6.5 compat: spl: properly unregister sysctl entries #15239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
spl fails to properly unload the registered sysctl entries when register_ssyctl_table() is not available in the kernel (>= 6.5).
Corresponding tracking bug in Ubuntu: https://bugs.launchpad.net/bugs/2034510
Description
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.
How Has This Been Tested?
When the problem happens spl fails to load and we can see the following line in dmesg:
Test has been reproduced in a local VM running the latest 6.5 upstream kernel.
Types of changes
Checklist:
Signed-off-by
.