diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2017-09-20 15:45:07 +0300 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2017-09-25 08:21:26 -0500 |
commit | a693437037328a95d815ad5aec37ac2f8e130e58 (patch) | |
tree | 1ffe0df80ff9476b798bd645bef54f8de0e3997f /block/nbd-client.c | |
parent | 93970672210ca1ee45fdebbc11e1fd97916c7c8e (diff) |
block/nbd-client: nbd_co_send_request: fix return code
It's incorrect to return success rc >= 0 if we skip qio_channel_writev_all()
call due to s->quit.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20170920124507.18841-4-vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block/nbd-client.c')
-rw-r--r-- | block/nbd-client.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/nbd-client.c b/block/nbd-client.c index ac93c4c0d0..72651dcdb1 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -161,6 +161,8 @@ static int nbd_co_send_request(BlockDriverState *bs, NULL) < 0) { rc = -EIO; } + } else if (rc >= 0) { + rc = -EIO; } qio_channel_set_cork(s->ioc, false); } else { |