diff options
author | Eric Blake <eblake@redhat.com> | 2018-01-10 17:08:22 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2018-01-17 20:14:12 -0600 |
commit | 32f158a63509656f95922ce28d1b4a4e06a2cbf2 (patch) | |
tree | a51e07813e3a8ded72da3e148716fec3e0c8a142 /nbd/server.c | |
parent | 0cfae925d2e31a7d7613a6fb60aa58b38ec2b61e (diff) |
nbd/server: Better error for NBD_OPT_EXPORT_NAME failure
When a client abruptly disconnects before we've finished reading
the name sent with NBD_OPT_EXPORT_NAME, we are better off logging
the failure as EIO (we can't communicate with the client), rather
than EINVAL (the client sent bogus data).
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180110230825.18321-4-eblake@redhat.com>
Diffstat (limited to 'nbd/server.c')
-rw-r--r-- | nbd/server.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nbd/server.c b/nbd/server.c index b9efdcc605..31c1d32429 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -299,7 +299,7 @@ static int nbd_negotiate_handle_export_name(NBDClient *client, } if (nbd_read(client->ioc, name, client->optlen, errp) < 0) { error_prepend(errp, "read failed: "); - return -EINVAL; + return -EIO; } name[client->optlen] = '\0'; client->optlen = 0; |