[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 47/78] qcow2: Fix alloc_cluster_abort() for pre-existing clusters
From: |
Michael Roth |
Subject: |
[PATCH 47/78] qcow2: Fix alloc_cluster_abort() for pre-existing clusters |
Date: |
Tue, 16 Jun 2020 09:15:16 -0500 |
From: Max Reitz <mreitz@redhat.com>
handle_alloc() reuses preallocated zero clusters. If anything goes
wrong during the data write, we do not change their L2 entry, so we
must not let qcow2_alloc_cluster_abort() free them.
Fixes: 8b24cd141549b5b264baeddd4e72902cfb5de23b
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200225143130.111267-2-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 3ede935fdbbd5f7b24b4724bbfb8938acb5956d8)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/qcow2-cluster.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index dc3c270226..f1a6d42df0 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1015,7 +1015,7 @@ err:
void qcow2_alloc_cluster_abort(BlockDriverState *bs, QCowL2Meta *m)
{
BDRVQcow2State *s = bs->opaque;
- if (!has_data_file(bs)) {
+ if (!has_data_file(bs) && !m->keep_old_clusters) {
qcow2_free_clusters(bs, m->alloc_offset,
m->nb_clusters << s->cluster_bits,
QCOW2_DISCARD_NEVER);
--
2.17.1
- [PATCH 36/78] dp8393x: Pad frames to word or long word boundary, (continued)
- [PATCH 36/78] dp8393x: Pad frames to word or long word boundary, Michael Roth, 2020/06/16
- [PATCH 37/78] dp8393x: Clear descriptor in_use field to release packet, Michael Roth, 2020/06/16
- [PATCH 38/78] dp8393x: Always update RRA pointers and sequence numbers, Michael Roth, 2020/06/16
- [PATCH 39/78] dp8393x: Don't reset Silicon Revision register, Michael Roth, 2020/06/16
- [PATCH 40/78] dp8393x: Don't stop reception upon RBE interrupt assertion, Michael Roth, 2020/06/16
- [PATCH 03/78] i386: Resolve CPU models to v1 by default, Michael Roth, 2020/06/16
- [PATCH 44/78] qcow2: update_refcount(): Reset old_table_index after qcow2_cache_put(), Michael Roth, 2020/06/16
- [PATCH 46/78] iotests: Test copy offloading with external data file, Michael Roth, 2020/06/16
- [PATCH 42/78] plugins/core: add missing break in cb_to_tcg_flags, Michael Roth, 2020/06/16
- [PATCH 45/78] qcow2: Fix qcow2_alloc_cluster_abort() for external data file, Michael Roth, 2020/06/16
- [PATCH 47/78] qcow2: Fix alloc_cluster_abort() for pre-existing clusters,
Michael Roth <=
- [PATCH 41/78] s390/sclp: improve special wait psw logic, Michael Roth, 2020/06/16
- [PATCH 48/78] iotests/026: Test EIO on preallocated zero cluster, Michael Roth, 2020/06/16
- [PATCH 04/78] qapi: better document NVMe blockdev @device parameter, Michael Roth, 2020/06/16
- [PATCH 43/78] tcg: save vaddr temp for plugin usage, Michael Roth, 2020/06/16
- [PATCH 49/78] iotests/026: Test EIO on allocation in a data-file, Michael Roth, 2020/06/16
- [PATCH 51/78] scsi/qemu-pr-helper: Fix out-of-bounds access to trnptid_list[], Michael Roth, 2020/06/16
- [PATCH 50/78] virtio: gracefully handle invalid region caches, Michael Roth, 2020/06/16
- [PATCH 52/78] block/qcow2-threads: fix qcow2_decompress, Michael Roth, 2020/06/16
- [PATCH 54/78] block/block-copy: fix progress calculation, Michael Roth, 2020/06/16
- [PATCH 53/78] job: refactor progress to separate object, Michael Roth, 2020/06/16