]> Git Repo - qemu.git/commit
nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection
authorPaolo Bonzini <[email protected]>
Thu, 14 Apr 2022 17:57:51 +0000 (19:57 +0200)
committerEric Blake <[email protected]>
Tue, 26 Apr 2022 18:16:36 +0000 (13:16 -0500)
commit8610b4491f02312f3bf0de10826fad7aa99ddfcf
tree77efdade695b102859eac3cdbd441183d21e1e7d
parent172f5f1a4058c361bfcd19317b0e3151556b3edb
nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection

Elevate s->in_flight early so that other incoming requests will wait
on the CoQueue in nbd_co_send_request; restart them after getting back
from nbd_reconnect_attempt.  This could be after the reconnect timer or
nbd_cancel_in_flight have cancelled the attempt, so there is no
need anymore to cancel the requests there.

nbd_co_send_request now handles both stopping and restarting pending
requests after a successful connection, and there is no need to
hold send_mutex in nbd_co_do_establish_connection.  The current setup
is confusing because nbd_co_do_establish_connection is called both with
send_mutex taken and without it.  Before the patch it uses free_sema which
(at least in theory...) is protected by send_mutex, after the patch it
does not anymore.

Signed-off-by: Paolo Bonzini <[email protected]>
Message-Id: <20220414175756[email protected]>
Reviewed-by: Eric Blake <[email protected]>
[eblake: wrap long line]
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Lukas Straub <[email protected]>
Signed-off-by: Eric Blake <[email protected]>
block/coroutines.h
block/nbd.c
This page took 0.029643 seconds and 4 git commands to generate.