diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-14 19:57:55 +0200 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2022-04-26 13:16:41 -0500 |
commit | a80a9a1c7397382fc4c4e6feaa8242b25cadb519 (patch) | |
tree | 2f717189fe6409c22cdf0f9599c6ba10a3000032 /block/parallels-ext.c | |
parent | dba5156c0e9c0362b7c6121f9e1c89bb9be1f227 (diff) |
nbd: take receive_mutex when reading requests[].receiving
requests[].receiving is set by nbd_receive_replies() under the receive_mutex;
Read it under the same mutex as well. Waking up receivers on errors happens
after each reply finishes processing, in nbd_co_receive_one_chunk().
If there is no currently-active reply, there are two cases:
* either there is no active request at all, in which case no
element of request[] can have .receiving = true
* or nbd_receive_replies() must be running and owns receive_mutex;
in that case it will get back to nbd_co_receive_one_chunk() because
the socket has been shutdown, and all waiting coroutines will wake up
in turn.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220414175756.671165-9-pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block/parallels-ext.c')
0 files changed, 0 insertions, 0 deletions