summaryrefslogtreecommitdiffstats
path: root/block/qcow2-cluster.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/qcow2-cluster.c')
-rw-r--r--block/qcow2-cluster.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 11f9c50..8534084 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1401,7 +1401,7 @@ int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset,
/* Round start up and end down */
offset = align_offset(offset, s->cluster_size);
- end_offset &= ~(s->cluster_size - 1);
+ end_offset = start_of_cluster(s, end_offset);
if (offset > end_offset) {
return 0;
OpenPOWER on IntegriCloud