Re: [PATCH] s390/debug: Fix deadlock during unregister

Heiko Carstens <[email protected]>
Newsgroups org.kernel.vger.linux-s390
Message-ID <[email protected]>
On Wed, Aug 12, 2026 at 09:53:19AM +0200, Peter Oberparleiter wrote:
> Unregistering an s390dbf debug area while one of the associated debugfs
> files is being written to can cause a deadlock:
> 
> $ echo >.../vmur/level    $ rmmod vmur
> ===================================================
> debugfs write
> debugfs_file_get()
>                           debug_unregister()
>                           mutex_lock(debug_mutex)
>                           debugfs_remove()
>                           wait for debugfs_file_put()
> debug_file_ops.write()
> debug_input()
> mutex_lock(debug_mutex) ==> DEADLOCK
> 
> Fix this by splitting debug_unregister() into an s390dbf and debugfs
> part, and running only the s390dbf part with debug_mutex locked.
> 
> Signed-off-by: Peter Oberparleiter <[email protected]>
> ---
>  arch/s390/kernel/debug.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)

Reviewed-by: Heiko Carstens <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.