提交 a6934370 编写于 作者: V Vladimir Sementsov-Ogievskiy 提交者: Eric Blake

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: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-Id: <20170920124507.18841-4-vsementsov@virtuozzo.com>
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 93970672
...@@ -161,6 +161,8 @@ static int nbd_co_send_request(BlockDriverState *bs, ...@@ -161,6 +161,8 @@ static int nbd_co_send_request(BlockDriverState *bs,
NULL) < 0) { NULL) < 0) {
rc = -EIO; rc = -EIO;
} }
} else if (rc >= 0) {
rc = -EIO;
} }
qio_channel_set_cork(s->ioc, false); qio_channel_set_cork(s->ioc, false);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册