From nobody Sun Oct 5 21:10:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530213128280978.2373494212183; Thu, 28 Jun 2018 12:12:08 -0700 (PDT) Received: from localhost ([::1]:38083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYcKt-0004x5-8N for importer@patchew.org; Thu, 28 Jun 2018 15:12:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYcGn-0001lg-Mi for qemu-devel@nongnu.org; Thu, 28 Jun 2018 15:08:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYcGe-0001Vd-VY for qemu-devel@nongnu.org; Thu, 28 Jun 2018 15:07:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33380 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fYcGP-00018j-V6; Thu, 28 Jun 2018 15:07:30 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43BE587A81; Thu, 28 Jun 2018 19:07:29 +0000 (UTC) Received: from red.redhat.com (ovpn-125-113.rdu2.redhat.com [10.10.125.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id B410D2026D69; Thu, 28 Jun 2018 19:07:28 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2018 14:07:20 -0500 Message-Id: <20180628190723.276458-4-eblake@redhat.com> In-Reply-To: <20180628190723.276458-1-eblake@redhat.com> References: <20180628190723.276458-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 28 Jun 2018 19:07:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 28 Jun 2018 19:07:29 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v7 3/6] qcow2: Reduce REFT_OFFSET_MASK X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, berto@igalia.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Match our code to the spec change in the previous patch - there's no reason for the refcount table to allow larger offsets than the L1/L2 tables. In practice, no image has more than 64PB of allocated clusters anyways, as anything beyond that can't be expressed via L2 mappings to host offsets. Suggested-by: Alberto Garcia Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia --- v4: new patch --- block/qcow2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.h b/block/qcow2.h index 01b5250415f..3774229ef9c 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -439,7 +439,7 @@ typedef enum QCow2MetadataOverlap { #define L2E_OFFSET_MASK 0x00fffffffffffe00ULL #define L2E_COMPRESSED_OFFSET_SIZE_MASK 0x3fffffffffffffffULL -#define REFT_OFFSET_MASK 0xfffffffffffffe00ULL +#define REFT_OFFSET_MASK 0x00fffffffffffe00ULL static inline int64_t start_of_cluster(BDRVQcow2State *s, int64_t offset) { --=20 2.14.4