[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/5] block/block-copy: fix s->copy_size for compressed cluster
From: |
Max Reitz |
Subject: |
[PULL 2/5] block/block-copy: fix s->copy_size for compressed cluster |
Date: |
Mon, 4 Nov 2019 10:03:44 +0100 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
0e2402452f1f20429 allowed writes larger than cluster, but that's
unsupported for compressed write. Fix it.
Fixes: 0e2402452f1f20429
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/block-copy.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/block-copy.c b/block/block-copy.c
index c39cc9cffe..79798a1567 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -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
--
2.21.0
- [PULL 0/5] Block patches for 4.2-rc0, Max Reitz, 2019/11/04
- [PULL 1/5] nvme: fix NSSRS offset in CAP register, Max Reitz, 2019/11/04
- [PULL 2/5] block/block-copy: fix s->copy_size for compressed cluster,
Max Reitz <=
- [PULL 3/5] block: Make wait/mark serialising requests public, Max Reitz, 2019/11/04
- [PULL 4/5] block: Add bdrv_co_get_self_request(), Max Reitz, 2019/11/04
- [PULL 5/5] block/file-posix: Let post-EOF fallocate serialize, Max Reitz, 2019/11/04
- Re: [PULL 0/5] Block patches for 4.2-rc0, Peter Maydell, 2019/11/06