nbd/server: fix sparse read
commit37e02aebf88f8a12f02457de207b09b607c1e8a8
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 8 Mar 2018 18:46:33 +0000 (8 21:46 +0300)
committerEric Blake <eblake@redhat.com>
Tue, 13 Mar 2018 20:38:55 +0000 (13 15:38 -0500)
treebe634841b12c2222eb0bca6d9826f8530dce641a
parent60ace2bacfbadb0cfae265929024dbece1ecf9af
nbd/server: fix sparse read

In case of io error in nbd_co_send_sparse_read we should not
"goto reply:", as it was a fatal error and the common behavior
is to disconnect in this case. We should not try to send the
client an additional error reply, since we already hit a
channel-io error on our previous attempt to send one.

Fix this by handling 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.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180308184636.178534-3-vsementsov@virtuozzo.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
nbd/server.c