summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-06-01 18:09:17 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2015-07-29 18:26:34 -0500
commitc631ee6520656aa5e3db01e4cc3203734ff63c63 (patch)
tree6b598f3bcf9cbad31f356595f597e09d15baf3e3
parentb153c8d3f3935f39d5a1b573d036b1f0f5a45812 (diff)
downloadqemu-c631ee6520656aa5e3db01e4cc3203734ff63c63.tar.gz
qcow2: Set MIN_L2_CACHE_SIZE to 2
The L2 cache must cover at least two L2 tables, because during COW two L2 tables are accessed simultaneously. Reported-by: Alexander Graf <agraf@suse.de> Cc: qemu-stable <qemu-stable@nongnu.org> Signed-off-by: Max Reitz <mreitz@redhat.com> Tested-by: Alexander Graf <agraf@suse.de> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 57e216695948a79d9ced82fc217a37cce70fd986) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--block/qcow2.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 422b825138..2f20949593 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -62,7 +62,8 @@
#define MIN_CLUSTER_BITS 9
#define MAX_CLUSTER_BITS 21
-#define MIN_L2_CACHE_SIZE 1 /* cluster */
+/* Must be at least 2 to cover COW */
+#define MIN_L2_CACHE_SIZE 2 /* clusters */
/* Must be at least 4 to cover all cases of refcount table growth */
#define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */