[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 28/34] vmdk: fix metadata write regression
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL v2 28/34] vmdk: fix metadata write regression |
Date: |
Wed, 13 Jul 2016 14:50:35 +0200 |
From: Reda Sallahi <address@hidden>
Commit "cdeaf1f vmdk: add bdrv_co_write_zeroes" causes a regression on
writes. It writes metadata after every write instead of doing it only once
for each cluster.
vmdk_pwritev() writes metadata whenever m_data is set as valid so this patch
sets m_data as valid only when we have a new cluster which hasn't been
allocated before or a zero grain.
Signed-off-by: Reda Sallahi <address@hidden>
Message-id: address@hidden
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/vmdk.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index c9914f7..46d474e 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1202,13 +1202,6 @@ static int get_cluster_offset(BlockDriverState *bs,
l2_index = ((offset >> 9) / extent->cluster_sectors) % extent->l2_size;
cluster_sector = le32_to_cpu(l2_table[l2_index]);
- if (m_data) {
- m_data->valid = 1;
- m_data->l1_index = l1_index;
- m_data->l2_index = l2_index;
- m_data->l2_offset = l2_offset;
- m_data->l2_cache_entry = &l2_table[l2_index];
- }
if (extent->has_zero_grain && cluster_sector == VMDK_GTE_ZEROED) {
zeroed = true;
}
@@ -1231,6 +1224,13 @@ static int get_cluster_offset(BlockDriverState *bs,
if (ret) {
return ret;
}
+ if (m_data) {
+ m_data->valid = 1;
+ m_data->l1_index = l1_index;
+ m_data->l2_index = l2_index;
+ m_data->l2_offset = l2_offset;
+ m_data->l2_cache_entry = &l2_table[l2_index];
+ }
}
*cluster_offset = cluster_sector << BDRV_SECTOR_BITS;
return VMDK_OK;
--
1.8.3.1
- [Qemu-devel] [PULL v2 09/34] commit: Add 'job-id' parameter to 'block-commit', (continued)
- [Qemu-devel] [PULL v2 09/34] commit: Add 'job-id' parameter to 'block-commit', Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 17/34] block/qdev: Allow node name for drive properties, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 19/34] commit: Fix use of error handling policy, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 14/34] coroutine: use QSIMPLEQ instead of QTAILQ, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 18/34] block/qdev: Allow configuring WCE with qdev properties, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 20/34] block/qdev: Allow configuring rerror/werror with qdev properties, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 16/34] coroutine: move entry argument to qemu_coroutine_create, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 25/34] qemu-io: Use correct range limitations, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 26/34] qcow2: Fix qcow2_get_cluster_offset(), Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 24/34] qcow2: Avoid making the L1 table too big, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 28/34] vmdk: fix metadata write regression,
Kevin Wolf <=
- [Qemu-devel] [PULL v2 22/34] block: Remove BB options from blockdev-add, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 29/34] blockdev: Fix regression with the default naming of throttling groups, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 31/34] hmp: use snapshot name to determine whether a snapshot is 'fully available', Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 30/34] qemu-iotests: Test naming of throttling groups, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 21/34] qemu-iotests: Test setting WCE with qdev, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 23/34] qemu-img: Use strerror() for generic resize error, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 27/34] Improve block job rate limiting for small bandwidth values, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 32/34] hmp: show all of snapshot info on every block dev in output of 'info snapshots', Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 34/34] iotests: Make 157 actually format-agnostic, Kevin Wolf, 2016/07/13
- [Qemu-devel] [PULL v2 33/34] vvfat: Fix qcow write target driver specification, Kevin Wolf, 2016/07/13