]> Git Repo - qemu.git/commitdiff
nbd: Fix 32-bit compilation on BLOCK_STATUS
authorEric Blake <[email protected]>
Tue, 27 Mar 2018 21:05:17 +0000 (16:05 -0500)
committerEric Blake <[email protected]>
Mon, 2 Apr 2018 13:45:21 +0000 (08:45 -0500)
iotests 123 and 209 fail on 32-bit platforms.  The culprit:
sizeof(extent) is wrong; we want sizeof(*extent).  But since
the struct is 8 bytes, it happened to work on 64-bit platforms
where the pointer is also 8 bytes (nasty).

Fixes: 78a33ab58
Reported-by: Max Reitz <[email protected]>
Signed-off-by: Eric Blake <[email protected]>
Message-Id: <20180327210517.1804242[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
block/nbd-client.c

index e64e346d6903af04e84f4c35828de4b64b1b22a4..e7caf49fbb47e25161b709250a30d543702049bc 100644 (file)
@@ -239,7 +239,7 @@ static int nbd_parse_blockstatus_payload(NBDClientSession *client,
 {
     uint32_t context_id;
 
-    if (chunk->length != sizeof(context_id) + sizeof(extent)) {
+    if (chunk->length != sizeof(context_id) + sizeof(*extent)) {
         error_setg(errp, "Protocol error: invalid payload for "
                          "NBD_REPLY_TYPE_BLOCK_STATUS");
         return -EINVAL;
This page took 0.027348 seconds and 4 git commands to generate.