]> Git Repo - qemu.git/commitdiff
nbd/server: Better error for NBD_OPT_EXPORT_NAME failure
authorEric Blake <[email protected]>
Wed, 10 Jan 2018 23:08:22 +0000 (17:08 -0600)
committerEric Blake <[email protected]>
Thu, 18 Jan 2018 02:14:12 +0000 (20:14 -0600)
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 <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20180110230825[email protected]>

nbd/server.c

index b9efdcc605df7589bd079135d274f65f1256ad88..31c1d324297faf0104633dc21713972a9a85d79a 100644 (file)
@@ -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;
This page took 0.029504 seconds and 4 git commands to generate.