[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/29] qcow2: Fix alloc_cluster_abort() for pre-existing clusters
From: |
Kevin Wolf |
Subject: |
[PULL 01/29] qcow2: Fix alloc_cluster_abort() for pre-existing clusters |
Date: |
Fri, 6 Mar 2020 18:14:30 +0100 |
From: Max Reitz <address@hidden>
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: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
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 78c95dfa16..17f1363279 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1026,7 +1026,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.20.1
- [PULL 00/29] Block layer patches, Kevin Wolf, 2020/03/06
- [PULL 02/29] iotests/026: Test EIO on preallocated zero cluster, Kevin Wolf, 2020/03/06
- [PULL 05/29] block: Introduce 'bdrv_reopen_commit_post' step, Kevin Wolf, 2020/03/06
- [PULL 04/29] block: Fix leak in bdrv_create_file_fallback(), Kevin Wolf, 2020/03/06
- [PULL 03/29] iotests/026: Test EIO on allocation in a data-file, Kevin Wolf, 2020/03/06
- [PULL 01/29] qcow2: Fix alloc_cluster_abort() for pre-existing clusters,
Kevin Wolf <=
- [PULL 07/29] qemu-storage-daemon: Add barebone tool, Kevin Wolf, 2020/03/06
- [PULL 08/29] stubs: Add arch_type, Kevin Wolf, 2020/03/06
- [PULL 14/29] qemu-storage-daemon: Add --object option, Kevin Wolf, 2020/03/06
- [PULL 06/29] block/qcow2: Move bitmap reopen into bdrv_reopen_commit_post, Kevin Wolf, 2020/03/06
- [PULL 16/29] blockdev-nbd: Boxed argument type for nbd-server-add, Kevin Wolf, 2020/03/06
- [PULL 13/29] qapi: Flatten object-add, Kevin Wolf, 2020/03/06
- [PULL 15/29] qemu-storage-daemon: Add --nbd-server option, Kevin Wolf, 2020/03/06
- [PULL 19/29] qemu-storage-daemon: Add --chardev option, Kevin Wolf, 2020/03/06
- [PULL 18/29] qemu-storage-daemon: Add main loop, Kevin Wolf, 2020/03/06
- [PULL 22/29] monitor: Create QAPIfied monitor_init(), Kevin Wolf, 2020/03/06