On Thu, Apr 14, 2022 at 07:57:55PM +0200, Paolo Bonzini wrote: > 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 <pbonz...@redhat.com> > --- > block/nbd.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-)
Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org