block/nbd-client: drop max_block restriction from block_status
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Wed, 1 Apr 2020 15:01:07 +0000 (18:01 +0300)
committerEric Blake <eblake@redhat.com>
Mon, 4 May 2020 20:13:14 +0000 (15:13 -0500)
The NBD spec was updated (see nbd.git commit 9f30fedb) so that
max_block doesn't relate to NBD_CMD_BLOCK_STATUS. So, drop the
restriction.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200401150112.9557-2-vsementsov@virtuozzo.com>
[eblake: tweak commit message to call out NBD commit]
Signed-off-by: Eric Blake <eblake@redhat.com>
block/nbd.c

index 2160859f649955c6c035ed459a09e9629167db40..d4d518a780c9f7d2d1f47cab90f9f068832c6a6f 100644 (file)
@@ -1320,9 +1320,7 @@ static int coroutine_fn nbd_client_co_block_status(
     NBDRequest request = {
         .type = NBD_CMD_BLOCK_STATUS,
         .from = offset,
-        .len = MIN(MIN_NON_ZERO(QEMU_ALIGN_DOWN(INT_MAX,
-                                                bs->bl.request_alignment),
-                                s->info.max_block),
+        .len = MIN(QEMU_ALIGN_DOWN(INT_MAX, bs->bl.request_alignment),
                    MIN(bytes, s->info.size - offset)),
         .flags = NBD_CMD_FLAG_REQ_ONE,
     };