From nobody Fri Dec 27 14:25:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1732819238; cv=none; d=zohomail.com; s=zohoarc; b=EZgtU6W3soZqo5N7yhju9DfKqtulJHZk3Mk/Mv7n9T4e7Ky8s+hRaX+p1oNQjCJqG+0PqhfpQdNdPU2EbTy945uwUT70TCjpUPNg6dVUsQDQy9zhVJMeE2Djk0UwaDtk0POZ8cz8rc+nH9gwXxYrLpfw8QXs7wCokNHYB+7pivo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732819238; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=eFKiUc6Dqon9qjQmOVmuIQxOp19FJBFUFGirXOnfNrE=; b=BPqt8nMGeeUDp/GRAhbJKZNzlWxid9600zOhrI4mwr8a58ddyWrabrUvkYAC8BfGvwkwO+0LY4it5ClNxXxTBOWs9zcAFh2W+7eABWDgXBtOSYza9DNi+5wMYEsjNwDJW6pLpMrD3nljaoZjf8ngEdM7zpTD4r48IODtbS0r5po= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1732819238102356.5641543750471; Thu, 28 Nov 2024 10:40:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGjQW-000735-Rc; Thu, 28 Nov 2024 13:39:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGjQN-0006zW-NH; Thu, 28 Nov 2024 13:39:35 -0500 Received: from relay.virtuozzo.com ([130.117.225.111]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGjQI-00060J-HN; Thu, 28 Nov 2024 13:39:34 -0500 Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=iris.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1tGjPo-00E2DN-0n; Thu, 28 Nov 2024 19:39:10 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=eFKiUc6Dqon9qjQmOVmuIQxOp19FJBFUFGirXOnfNrE=; b=aPHeyWz1z4gU zve7/yxfXxeEtK5LB5WXNzFm9OgeV7yXQ1aa3lwIIh8Tey/pPqRjyu7EBgXmzLuHFChL5+TkkOtlI 0NVbM/Dw1LggV5Fck5cxnTe/qqEIkn+r1S/Hu83QlkKgDi7dvu6ChF1kQjow1Ev2LqScWCaSSr2lO gtLaXsNbfm+9tXDFt/BeIwW5MD89neQ43IEkQkpB1IfWFQExA10zorms7bM7sbch1NNCBngOt47DA NlXMgMkdvCDMwywuGFzeOJ0XFizjXHyIB9o2YectRUVZEM+wh3OkHMFbX8bF0OeklCfXanuJkYGsh 2dqEBLGGM0yvpTUmJNcy5Q==; To: qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: den@openvz.org, Vladimir Sementsov-Ogievskiy , Andrey Drobyshev , Kevin Wolf , Hanna Reitz Subject: [PATCH 2/6] preallocate: do not enable filter inside preallocate_co_getlength() Date: Thu, 28 Nov 2024 19:25:49 +0100 Message-ID: <20241128183911.837699-3-den@openvz.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241128183911.837699-1-den@openvz.org> References: <20241128183911.837699-1-den@openvz.org> MIME-Version: 1.0 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=130.117.225.111; envelope-from=den@openvz.org; helo=relay.virtuozzo.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Reply-to: "Denis V. Lunev" From: "Denis V. Lunev" via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1732819238684019100 Content-Type: text/plain; charset="utf-8" Let us auto-enable it inside handle_write() and truncate(), i.e. on the actual write operation. This just makes things more relaxing. Signed-off-by: Denis V. Lunev CC: Vladimir Sementsov-Ogievskiy CC: Andrey Drobyshev CC: Kevin Wolf CC: Hanna Reitz --- block/preallocate.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/block/preallocate.c b/block/preallocate.c index c14e6a530d..d0ed56eecb 100644 --- a/block/preallocate.c +++ b/block/preallocate.c @@ -494,20 +494,13 @@ static int coroutine_fn GRAPH_RDLOCK preallocate_co_f= lush(BlockDriverState *bs) static int64_t coroutine_fn GRAPH_RDLOCK preallocate_co_getlength(BlockDriverState *bs) { - int64_t ret; BDRVPreallocateState *s =3D bs->opaque; =20 if (s->data_end >=3D 0) { return s->data_end; } =20 - ret =3D bdrv_co_getlength(bs->file->bs); - - if (has_prealloc_perms(bs)) { - s->file_end =3D s->zero_start =3D s->data_end =3D ret; - } - - return ret; + return bdrv_co_getlength(bs->file->bs); } =20 static int GRAPH_RDLOCK --=20 2.45.2