aboutsummaryrefslogtreecommitdiff
path: root/nbd
diff options
context:
space:
mode:
Diffstat (limited to 'nbd')
-rw-r--r--nbd/server.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/nbd/server.c b/nbd/server.c
index 5f292064af..b230ecb4fb 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -1543,14 +1543,6 @@ static coroutine_fn void nbd_trip(void *opaque)
req = nbd_request_get(client);
ret = nbd_co_receive_request(req, &request, &local_err);
client->recv_coroutine = NULL;
- nbd_client_receive_next_request(client);
- if (ret == -EIO) {
- goto disconnect;
- }
-
- if (ret < 0) {
- goto reply;
- }
if (client->closing) {
/*
@@ -1560,6 +1552,15 @@ static coroutine_fn void nbd_trip(void *opaque)
goto done;
}
+ nbd_client_receive_next_request(client);
+ if (ret == -EIO) {
+ goto disconnect;
+ }
+
+ if (ret < 0) {
+ goto reply;
+ }
+
switch (request.type) {
case NBD_CMD_READ:
/* XXX: NBD Protocol only documents use of FUA with WRITE */