From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzSHP-0003by-OD for qemu-devel@nongnu.org; Mon, 01 Jun 2015 12:09:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzSHK-0005as-4I for qemu-devel@nongnu.org; Mon, 01 Jun 2015 12:09:35 -0400 From: Max Reitz Date: Mon, 1 Jun 2015 18:09:17 +0200 Message-Id: <1433174959-7176-2-git-send-email-mreitz@redhat.com> In-Reply-To: <1433174959-7176-1-git-send-email-mreitz@redhat.com> References: <1433174959-7176-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 1/3] qcow2: Set MIN_L2_CACHE_SIZE to 2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: Kevin Wolf , Max Reitz , Alberto Garcia , qemu-devel@nongnu.org, Alexander Graf 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 --- block/qcow2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/qcow2.h b/block/qcow2.h index 0076512..aa20022 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 */ -- 2.4.1