From nobody Sun Feb 8 12:52:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639063532; cv=none; d=zohomail.com; s=zohoarc; b=kTgIVHwcSsgBw/2GnVHjqNuDM0I9/4dcvQa8ywEFfBu+nRQFNAlyGaFGMtdq/puvlOrYCrwZ+RqfoMh7yYmsNDMsMDsnglqskdG3v43zvEXay9KPn7CQioymFh70yLoBfJ+TtwnRHJTOCuHNb3iqSkomYhp6AC6NgWZUuEVky84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639063532; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LILtCWFZXwrUjsjxSL9DCVD9cFqDqkPTnD4ChBgUzFU=; b=meBv3kvgb9DY9IYcR/k0kbH3GLIkxY0GsRId+t9m2VFoWCGIpM2MmzaILvJwBhZ1ZtI+QnigyXfaVQraMEwWDF+g5SKe7sjvoMw+7Y/ZgBceMGVnNQMq/9Zjf+TCGKLA2jbwsD4MR8fA/OV29jhSqU3pWo0pHNZUadA1nTaqIZA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1639063532633360.8758160017445; Thu, 9 Dec 2021 07:25:32 -0800 (PST) Received: from localhost ([::1]:35086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvLIX-000324-NQ for importer@patchew.org; Thu, 09 Dec 2021 10:25:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvLFo-0006Sb-0q for qemu-devel@nongnu.org; Thu, 09 Dec 2021 10:22:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24303) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvLFl-0000Rk-Fi for qemu-devel@nongnu.org; Thu, 09 Dec 2021 10:22:39 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-99-by83AjBCPnWlyMp_wh3p7w-1; Thu, 09 Dec 2021 10:22:25 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58D2D100C660; Thu, 9 Dec 2021 15:22:24 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.193.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 820465BE0A; Thu, 9 Dec 2021 15:22:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639063355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LILtCWFZXwrUjsjxSL9DCVD9cFqDqkPTnD4ChBgUzFU=; b=cxgvo+5YqRZB8eRQi/E59P2urzoYD6QwRCcMR013M89Mibryil6IhQOpmibVH3ym/1hCn7 bHXvvqVh9OHCTowMqCZW6IZjqPla2am+LBRwmnNf121D9hzWoz6xlvqBMsCfeMx+VzKoyg tEpnrCuezQO/9eJngg3xnVkSZSpqDok= X-MC-Unique: by83AjBCPnWlyMp_wh3p7w-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH] vvfat: Fix size of temporary qcow file Date: Thu, 9 Dec 2021 16:18:15 +0100 Message-Id: <20211209151815.23495-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.618, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639063533463100001 Content-Type: text/plain; charset="utf-8" The size of the qcow size was calculated so that only the FAT partition would fit on it, but not the whole disk. However, offsets relative to the whole disk are used to access it, so increase its size to be large enough for that. Signed-off-by: Kevin Wolf --- block/vvfat.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index 05e78e3c27..9deb552e0e 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1230,6 +1230,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *op= tions, int flags, dirname, cyls, heads, secs)); =20 s->sector_count =3D cyls * heads * secs - s->offset_to_bootsector; + bs->total_sectors =3D cyls * heads * secs; =20 if (qemu_opt_get_bool(opts, "rw", false)) { if (!bdrv_is_read_only(bs)) { @@ -1250,8 +1251,6 @@ static int vvfat_open(BlockDriverState *bs, QDict *op= tions, int flags, } } =20 - bs->total_sectors =3D cyls * heads * secs; - if (init_directories(s, dirname, heads, secs, errp)) { ret =3D -EIO; goto fail; @@ -3137,8 +3136,8 @@ static int enable_write_target(BlockDriverState *bs, = Error **errp) } =20 opts =3D qemu_opts_create(bdrv_qcow->create_opts, NULL, 0, &error_abor= t); - qemu_opt_set_number(opts, BLOCK_OPT_SIZE, s->sector_count * 512, - &error_abort); + qemu_opt_set_number(opts, BLOCK_OPT_SIZE, + bs->total_sectors * BDRV_SECTOR_SIZE, &error_abort= ); qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, "fat:", &error_abort); =20 ret =3D bdrv_create(bdrv_qcow, s->qcow_filename, opts, errp); --=20 2.31.1