Commit 32f158a6 authored by Eric Blake's avatar Eric Blake
Browse files

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: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180110230825.18321-4-eblake@redhat.com>
parent 0cfae925
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;