diff mbox series

[v2,11/13] qcow2: Audit for read/write 64-bit cleanness

Message ID 20181115020334.1189829-12-eblake@redhat.com (mailing list archive)
State New, archived
Headers show
Series block: byte-based blocking read/write | expand

Commit Message

Eric Blake Nov. 15, 2018, 2:03 a.m. UTC
The qcow2 read/write functions do their own fragmentation (because
of cluster remapping); while we could advertise s->cluster_size
and let the block layer do fragmentation for us, that would NOT
solve the issue of the block layer handing us a length less than
a cluster but at an offset which overlaps a cluster boundary. Thus,
we still have to fragment ourselves, at which point it is easiest
to just document that this driver is 64-bit clean.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/qcow2.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/block/qcow2.c b/block/qcow2.c
index 0b5ad130060..1dd3491f77f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1687,6 +1687,7 @@  static void qcow2_refresh_limits(BlockDriverState *bs, Error **errp)
     }
     bs->bl.pwrite_zeroes_alignment = s->cluster_size;
     bs->bl.pdiscard_alignment = s->cluster_size;
+    bs->bl.max_transfer = INT64_MAX;
 }

 static int qcow2_reopen_prepare(BDRVReopenState *state,