HomeFreeBSD

Linux 6.5 compat: safe cleanup in spl_proc_fini()

Description

Linux 6.5 compat: safe cleanup in spl_proc_fini()

If we fail to create a proc entry in spl_proc_init() we may end up
calling unregister_sysctl_table() twice: one in the failure path of
spl_proc_init() and another time during spl_proc_fini().

Avoid the double call to unregister_sysctl_table() and while at it
refactor the code a bit to reduce code duplication.

This was accidentally introduced when the spl code was
updated for Linux 6.5 compatibility.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Closes #15234
Closes #15235

Details

Provenance
Andrea Righi <andrea.righi@canonical.com>Authored on Sep 2 2023, 12:21 AM
Tony Hutter <hutter2@llnl.gov>Committed on Sep 11 2023, 11:34 PM
Parents
rGc74a17a498df: Linux 6.5 compat: Use copy_splice_read instead of filemap_splice_read
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rGcb28c0b7701e: Linux 6.5 compat: safe cleanup in spl_proc_fini() (authored by Andrea Righi <andrea.righi@canonical.com>).Sep 11 2023, 11:34 PM