block/block-copy: fix s->copy_size for compressed cluster
PATCH 1/1 block/block-copy: fix s->copy_size for compressed cluster
0e2402452f1f20429 allowed writes larger than cluster, but that's unsupported for compressed write. Fix it.
Fixes 0e2402452f1f20429
Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>
--- block/block-copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
block/block-copy.c +2 -2
@@ -109,9 +109,9 @@ BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, s->use_copy_range = false; s->copy_size = cluster_size; }else if (write_flags &BDRV_REQ_WRITE_COMPRESSED ) { -/* Compression is not supported for copy_range */ +/* Compression supports only cluster-size writes and no copy-range. */ s->use_copy_range = false; - s->copy_size =MAX (cluster_size,BLOCK_COPY_MAX_BUFFER ); + s->copy_size = cluster_size; }else {/* * copy_range does not respect max_transfer (it's a TODO), so we factor
Signature · 1 line
2.21.0
Max Reitz
AppliedQuoted 8 lines · Vladimir Sementsov-Ogievskiy
0e2402452f1f20429allowed writes larger than cluster, but that's unsupported for compressed write. Fix it.Fixes 0e2402452f1f20429Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>--- block/block-copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks, applied to my block branch:
https://git.xanclic.moe/XanClic/qemu/commits/branch/block
Max