From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKm7C-0005SB-Jp for qemu-devel@nongnu.org; Thu, 30 Jul 2015 07:35:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKm78-00029e-FM for qemu-devel@nongnu.org; Thu, 30 Jul 2015 07:35:10 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:50005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKm78-00026d-89 for qemu-devel@nongnu.org; Thu, 30 Jul 2015 07:35:06 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Jul 2015 05:35:05 -0600 From: Michael Roth Date: Thu, 30 Jul 2015 06:32:34 -0500 Message-Id: <1438255988-10418-20-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1438255988-10418-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1438255988-10418-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 19/53] qcow2: Set MIN_L2_CACHE_SIZE to 2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-stable@nongnu.org, Max Reitz From: Max Reitz 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 (cherry picked from commit 57e216695948a79d9ced82fc217a37cce70fd986) Signed-off-by: Michael Roth --- block/qcow2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/qcow2.h b/block/qcow2.h index 422b825..2f20949 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 */ -- 1.9.1