On 03/05/2018 01:47 PM, Eric Blake wrote:
On 03/05/2018 12:04 PM, Vladimir Sementsov-Ogievskiy wrote:
In the subject line: s/space/sparse/
In case of io error in nbd_co_send_sparse_read we should not
"goto reply:", as it is fatal error and common behavior is
disconnect in this case. We should not try to send client an
error reply, representing channel-io error on previous try to
send a reply.
Good catch.
Fix this by handle block-status error in nbd_co_send_sparse_read,
so nbd_co_send_sparse_read fails only on io error. Then just skip
common "reply:" code path in nbd_trip.
Note: nbd_co_send_structured_error is moved without changes to be
called from nbd_co_send_sparse_read.
Might be easier to read as two patches, one for the code motion, the
other for using the new code. But I'm not going to insist on a split.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org