ref_tracker: do xarray and workqueue job initializations earlier
PATCH 1/1 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.
--- lib/ref_tracker.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
lib/ref_tracker.c +8 -2
@@ -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 */
---
base-commit: a9b24b3583ae1da7dbda031f141264f2da260219
change-id: 20250626-reftrack-dbgfs-ed396c24853e
Best regards,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 6 lines · On Thu, 26 Jun 2025 08:52:14 -0400 Jeff Layton wrote:
The kernel test robot reported an oops that occurred when attempting to deregister a dentry from the xarray during
subsys_initcall().The
ref_trackerxarrays and workqueue job are being initialized inlate_initcall()which is too late. Move those topostcore_initcall()instead.
Applied to net-next (on top of an -rc tag again, if anyone else needs it). Thanks!