[PATCH 5.18 255/339] md: protect md_unregister_thread from reentrancy