[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 32/35] qcow2: initialize metadata before inserting i
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 32/35] qcow2: initialize metadata before inserting in cluster_allocs |
Date: |
Mon, 12 Sep 2011 16:19:31 +0200 |
From: Frediano Ziglio <address@hidden>
QCow2Meta structure was inserted into list before many fields are
initialized. Currently is not a problem cause all occur in a lock
but if qcow2_alloc_clusters would in a future unlock this lock
some issues could arise.
Initializing fields before inserting fix the problem.
Signed-off-by: Frediano Ziglio <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-cluster.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 113db8b..428b5ad 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -806,6 +806,11 @@ again:
abort();
}
+ /* save info needed for meta data update */
+ m->offset = offset;
+ m->n_start = n_start;
+ m->nb_clusters = nb_clusters;
+
QLIST_INSERT_HEAD(&s->cluster_allocs, m, next_in_flight);
/* allocate a new cluster */
@@ -816,11 +821,6 @@ again:
goto fail;
}
- /* save info needed for meta data update */
- m->offset = offset;
- m->n_start = n_start;
- m->nb_clusters = nb_clusters;
-
out:
ret = qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table);
if (ret < 0) {
--
1.7.6
- [Qemu-devel] [PATCH 20/35] scsi-disk: Fix START_STOP to fail when it can't eject, (continued)
- [Qemu-devel] [PATCH 20/35] scsi-disk: Fix START_STOP to fail when it can't eject, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 28/35] block: Reset buffer alignment on detach, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 24/35] block: Show whether the virtual tray is open in info block, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 31/35] ide/atapi scsi-disk: Make monitor eject -f, then change work, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 35/35] qcow2: fix range check, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 34/35] qcow2: align cluster_data to block to improve performance using O_DIRECT, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 19/35] ide/atapi: Don't fail eject when tray is already open, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 25/35] block: Move BlockConf & friends from block_int.h to block.h, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 26/35] hw: Trim superfluous #include "block_int.h", Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 30/35] block: New change_media_cb() parameter load, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 32/35] qcow2: initialize metadata before inserting in cluster_allocs,
Kevin Wolf <=
- [Qemu-devel] [PATCH 23/35] block: Drop BlockDriverState member removable, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 33/35] ahci: Remove unused struct member, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 17/35] rbd: clean up, fix style, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 18/35] rbd: fix leak in qemu_rbd_open failure paths, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 29/35] nbd: Clean up use of block_int.h, Kevin Wolf, 2011/09/12
- [Qemu-devel] [PATCH 27/35] block: New bdrv_set_buffer_alignment(), Kevin Wolf, 2011/09/12
- Re: [Qemu-devel] [PULL 00/35] Block patches, Anthony Liguori, 2011/09/15