]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
nbd: Fix hung on disconnect request if socket is closed before
authorXie Yongji <xieyongji@bytedance.com>
Tue, 22 Mar 2022 08:06:39 +0000 (16:06 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:50 +0000 (09:23 +0200)
commit6aecae606dd478034a484ee44445604e7949e357
treec0c50d23128bf4701e6ee8c890dc4ef852d5bda0
parent4b69f1e91374b5a42a2a2c3abe658c17e2a73c9a
nbd: Fix hung on disconnect request if socket is closed before

BugLink: https://bugs.launchpad.net/bugs/1981864
[ Upstream commit 491bf8f236fdeec698fa6744993f1ecf3fafd1a5 ]

When userspace closes the socket before sending a disconnect
request, the following I/O requests will be blocked in
wait_for_reconnect() until dead timeout. This will cause the
following disconnect request also hung on blk_mq_quiesce_queue().
That means we have no way to disconnect a nbd device if there
are some I/O requests waiting for reconnecting until dead timeout.
It's not expected. So let's wake up the thread waiting for
reconnecting directly when a disconnect request is sent.

Reported-by: Xu Jianhai <zero.xu@bytedance.com>
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/r/20220322080639.142-1-xieyongji@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/block/nbd.c