Re: [PATCH] ocfs2/dlm: drain join handlers before releasing module text
From: Cen Zhang
Date: Thu Oct 22 2026 - 05:12:24 EST
Hi Joseph,
Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx> 于2026年10月21日周三 21:02写道:
>
> dlm_unregister_net_handlers() is also reached from the dlm_init() error
> label on failures that happen before any handler was ever registered.
> So in case of an empty dlm_join_handlers, o2net_unregister_handler_list()
> walks nothing, but o2net_flush_wq() still takes o2net_wq_mutex and drains
> the entire o2net workqueue.
>
> Thanks,
> Joseph
>
Thanks for pointing this out. I've added a nonempty-list guard in
dlm_unregister_net_handlers() before calling
o2net_unregister_and_flush_handler_list().
Early init failures now skip the global flush. Partial registration
failure still unregisters and drains the published handlers; the
subsequent cleanup from dlm_init() sees the empty list and skips the
redundant flush.
The list is private to the serialized module init/exit paths.
Nonempty lists retain the full unregister-and-flush operation, and
the generic o2net helper is unchanged.
This change is included in v2.
Best regards,
Cen Zhang