]> git.ipfire.org Git - thirdparty/linux.git/commit
nvmet-tcp: fixup hang in nvmet_tcp_listen_data_ready()
authorHannes Reinecke <hare@kernel.org>
Mon, 18 Aug 2025 09:32:45 +0000 (11:32 +0200)
committerKeith Busch <kbusch@kernel.org>
Tue, 13 Jan 2026 15:29:46 +0000 (07:29 -0800)
commit2fa8961d3a6a1c2395d8d560ffed2c782681bade
tree9645b2466995425a58b70d90602eb260f9065c2e
parentd1877cc7270302081a315a81a0ee8331f19f95c8
nvmet-tcp: fixup hang in nvmet_tcp_listen_data_ready()

When the socket is closed while in TCP_LISTEN a callback is run to
flush all outstanding packets, which in turns calls
nvmet_tcp_listen_data_ready() with the sk_callback_lock held.
So we need to check if we are in TCP_LISTEN before attempting
to get the sk_callback_lock() to avoid a deadlock.

Link: https://lore.kernel.org/linux-nvme/CAHj4cs-zu7eVB78yUpFjVe2UqMWFkLk8p+DaS3qj+uiGCXBAoA@mail.gmail.com/
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/tcp.c