From: Max Reitz Date: Mon, 1 Jun 2015 16:09:17 +0000 (+0200) Subject: qcow2: Set MIN_L2_CACHE_SIZE to 2 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=57e216695948a79d9ced82fc217a37cce70fd986;p=qemu.git 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 Cc: qemu-stable Signed-off-by: Max Reitz Tested-by: Alexander Graf Reviewed-by: Alberto Garcia Signed-off-by: Kevin Wolf --- diff --git a/block/qcow2.h b/block/qcow2.h index 0076512af4..aa200223ce 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 */