aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ref_tracker.c
diff options
context:
space:
mode:
authorJeff Layton <[email protected]>2025-06-26 12:52:14 +0000
committerJakub Kicinski <[email protected]>2025-06-27 20:20:29 +0000
commitf4e6aefb9c6d8f9a5baa2a26bddaff4fbb4d280e (patch)
tree3c878f3843ee1219b769706f8bcef51bed035b0c /lib/ref_tracker.c
parentref_tracker: eliminate the ref_tracker_dir name field (diff)
downloadkernel-f4e6aefb9c6d8f9a5baa2a26bddaff4fbb4d280e.tar.gz
kernel-f4e6aefb9c6d8f9a5baa2a26bddaff4fbb4d280e.zip
ref_tracker: do xarray and workqueue job initializations earlier
The kernel test robot reported an oops that occurred when attempting to deregister a dentry from the xarray during subsys_initcall(). The ref_tracker xarrays and workqueue job are being initialized in late_initcall() which is too late. Move those to postcore_initcall() instead. Fixes: 65b584f53611 ("ref_tracker: automatically register a file in debugfs for a ref_tracker_dir") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-lkp/[email protected] Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'lib/ref_tracker.c')
-rw-r--r--lib/ref_tracker.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
index dcf923a1edf5..a9e6ffcff04b 100644
--- a/lib/ref_tracker.c
+++ b/lib/ref_tracker.c
@@ -516,13 +516,19 @@ static void debugfs_reap_work(struct work_struct *work)
} while (reaped);
}
-static int __init ref_tracker_debugfs_init(void)
+static int __init ref_tracker_debugfs_postcore_init(void)
{
INIT_WORK(&debugfs_reap_worker, debugfs_reap_work);
xa_init_flags(&debugfs_dentries, XA_FLAGS_LOCK_IRQ);
xa_init_flags(&debugfs_symlinks, XA_FLAGS_LOCK_IRQ);
+ return 0;
+}
+postcore_initcall(ref_tracker_debugfs_postcore_init);
+
+static int __init ref_tracker_debugfs_late_init(void)
+{
ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
return 0;
}
-late_initcall(ref_tracker_debugfs_init);
+late_initcall(ref_tracker_debugfs_late_init);
#endif /* CONFIG_DEBUG_FS */