From patchwork Thu Dec 28 10:12:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivanov X-Patchwork-Id: 13505817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32698C4706F for ; Thu, 28 Dec 2023 10:17:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rInON-0005fU-Em; Thu, 28 Dec 2023 05:13:31 -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 1rInNv-0005MP-86; Thu, 28 Dec 2023 05:13:04 -0500 Received: from mail-vi1eur05on20707.outbound.protection.outlook.com ([2a01:111:f400:7d00::707] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rInNt-0000Sp-Ky; Thu, 28 Dec 2023 05:13:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BzBtrv+FYoKdjgn7ZFSmoVkmZYrgbqnmj5qbKFgtp8+OoW2opQTINYN9uYtncLqBKSLmzG9vNab6vBZS11nWuZMngQKMqxhLiu5nhZNF5j3w1ntdYTpSvu9505cxso9J80poCJu0OD9b4O42yEg6Wgti8TTfgzGyoJ92Pl8GghOXCmJUuB5/X8oUdIPWb0JGpJaOro7gUuPYTMKNRd3Q152Ayymig0SfMwQoLWxQhnrc9XcxKzqJmTRrjaR9D+lvJF634S68u6sdFVr8jsLJRES6/D8v/a8gyRWGFwqLdOgy2zSVVDDrtA4NArKp3XDhiWkZGp7564x4B8/VqGcnzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e3JRRZLsEPXH1NNIs6vNbF/7zbteI2Z70fhLrLAUmgc=; b=ghomKrYuOTyiO4ApNqYSsJBU9QTqoqbr9UdYR27DKsT8bdmqRUa6bpymvhcnqC03UOkdIuSvgnnPoGj8zGh0CCKMRQUPE3HLboa63pA9ipXWXaw0JEuxZuSUpFX0mYHytX0Ob/1GAg1KH0QOc2j4QWtzSqzt+ILsu0LxWNDYgMRK5Ii43dVN/0wRGoSKDc++bXQkuSprBLl6mFE1SLaf7n6Sj3NEbyzu5G1chLE3E0RFLsgwwEJIosbpy2U7buh/745+4wcsihdknjfHAOwxGPJwVh6ESVToFIcXutsjMGU2lcMQJ6PEsZKPFLJQjl7lnNJzFy5lIJbsHJduLsvW3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e3JRRZLsEPXH1NNIs6vNbF/7zbteI2Z70fhLrLAUmgc=; b=eqDG8qNHq+ABQu0do56Ou1efeOI2GX6UyRuYDwVd7pQ3Z2qVGzwfJt/9Q3m59lTBXzfkMS7ArrwwFjbjDbMXL4O9+COQW6mhwh4NU8vbN7tC+hZPMOZm1mwvjEPXoq55mqTHuWPZcXqQ2LuWbjb/Tdnlx/8ydC7DbWUTfIQNReZcarYIUiGIRN0rXsv/kfO0YZApoIH+iHlMppIBtlOIGzFWX6dBhG+UfmSmX0jfWaitL1Tg3KiyDGmxf5BCkz4ulDtTnLpauIc6rLnvz4nqK4jtqxGKgLqXWakvV4eoGZtpe9X24KVMogq4ACbAMwBg+g3glfYvCNlAWAAKwNRu5g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from VI0PR08MB10743.eurprd08.prod.outlook.com (2603:10a6:800:205::19) by PA4PR08MB7459.eurprd08.prod.outlook.com (2603:10a6:102:2a6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.19; Thu, 28 Dec 2023 10:12:45 +0000 Received: from VI0PR08MB10743.eurprd08.prod.outlook.com ([fe80::60f7:3267:9f9d:cdc0]) by VI0PR08MB10743.eurprd08.prod.outlook.com ([fe80::60f7:3267:9f9d:cdc0%5]) with mapi id 15.20.7135.019; Thu, 28 Dec 2023 10:12:45 +0000 From: Alexander Ivanov To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, den@virtuozzo.com, stefanha@redhat.com, vsementsov@yandex-team.ru, kwolf@redhat.com, hreitz@redhat.com Subject: [PATCH v4 10/21] parallels: Create used bitmap even if checks needed Date: Thu, 28 Dec 2023 11:12:21 +0100 Message-Id: <20231228101232.372142-11-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231228101232.372142-1-alexander.ivanov@virtuozzo.com> References: <20231228101232.372142-1-alexander.ivanov@virtuozzo.com> X-ClientProxiedBy: FR4P281CA0044.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c7::8) To VI0PR08MB10743.eurprd08.prod.outlook.com (2603:10a6:800:205::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI0PR08MB10743:EE_|PA4PR08MB7459:EE_ X-MS-Office365-Filtering-Correlation-Id: c878398e-0aba-4d74-e686-08dc078d8936 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qX5l26dWspE2W19UZQ675sIqO6xoD1j/n4Lrt78ewCZpeNMKLQCzOsD/hx3T1OAf23/H81ND6SKb9JmOPvjZxIzEQCL5vXqon/AKbdglo2/rJdycXKhStWMlwTAJTy9VBVZ2Kv0MK1KZAuX7UDQb8swuQp9ZYT4cppGMknyF4WkPabrUeegXtYmTz1RPvD5mw83jmo/NkNHcuCdtk25TLPX1HKktCuR01Bbh5H/HVanppMGklbnUWh1l87KKHTQBipFPMYmpgEX3fHxEur0cp7YZiaKoLoOdtTl31mn50vaalcuomceXuT55KYTFInHrMYaYsXkTArVQyIrludkd2TTCuD5syroIlrhMe5Hvnl7se7LBdxPjPPqEkClVkx5iibZ30rN0+04YwA0hf89NaZlfxrqSMJ+yb7MTk24E6+vJTXfvGrY8kPh1C47nV0gMKOGT2WeGDMEY8bgnEEL8F/NeMqYfNLkyJdmjy7Qy0ET0FTdrHipgtJiZO7TsKeMK5TrJ8Sy76FJkGqxu7moaLL8VRMdAnWyTcNCkndOiOo/m0N9xiwLu2mRZhn6vEDKttgi3bEEtZLZbKKW6eLzOtbB0RmbGqBTbYifRIUT1Sw27KE6B96oCX3rS9plx+a+d X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI0PR08MB10743.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(396003)(346002)(39850400004)(366004)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(2616005)(26005)(1076003)(6666004)(6512007)(52116002)(6506007)(83380400001)(6916009)(478600001)(4326008)(8936002)(8676002)(4744005)(5660300002)(44832011)(6486002)(66556008)(66476007)(66946007)(316002)(38100700002)(86362001)(41300700001)(38350700005)(36756003)(2906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l9hGicLlvuHtNf5WMsSM4ezgyQijurqh41IDxFgxKEnf2TnP/bIV7+OZ/SSkcG5XD6498MABtepaUNA/iaaY+ymKKNQASwuODmY1Qootz1/5orMby1/yf2WwGj7IBRE2z20Xf+MW+56DlrrFJA7elP0AILDSYO4/ycDffjLKCDscyp3Ep1tnTXIuYGUtJ4Ey0cb+tZ7wj+bOrDAWUzWHkW9pF+kpCSnQ75TqMwW+wlAiJjU50/L21Y65xQFYmaYdZUa29tdJ4IEs1Syl+vLduHa0m6trduqRGPqME8uiYobuEv5e6TrWzknLK719LYv7M791htvuJ1eRVU3qVuJMwJYhqGego9+opAg+RO3yyH83C9D2YRiRibVb7ygiq6bwq8kxXET2gsG/vpfAsSgDFd/0s3jwTkID36EEXt3rwdQ57Jzp8TnBGHg75yL8NBz4Tk9CpduWO3/x3Duf2MSp4xcKE3cMeJ6EwiqulcdZU4M5V+J9iuXZrJ0hJPS4LqcsYbKHZjBc/BYKJkVZNKN95y/REapMObwHvV+2PJA5OW33dIC/kNJwCssHGBdCJb/+Hbp7aWzWjLVs4+cE06mKVTT5XdXXfcfc4+daaNPjjZ/M+iQfAy8GokMyfqXET8wyY= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c878398e-0aba-4d74-e686-08dc078d8936 X-MS-Exchange-CrossTenant-AuthSource: VI0PR08MB10743.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2023 10:12:45.5171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BVLdprERXsudFmg17iVow2IuykE52b40j+ZN6RAjWotAilnrRgxdDtsmQ1UT2271zVqqnwjn8QUhIsT0b/fHP/O9+ZHHboNeHHBCLulWCno= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7459 Received-SPF: pass client-ip=2a01:111:f400:7d00::707; envelope-from=alexander.ivanov@virtuozzo.com; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org All the checks were fixed to work with used bitmap. Create used bitmap in parallels_open() even if need_check is true. Signed-off-by: Alexander Ivanov --- block/parallels.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 0ae06ec0b1..f38dd2309c 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -1421,13 +1421,11 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, } need_check = need_check || s->data_end > file_nb_sectors; - if (!need_check) { - ret = parallels_fill_used_bitmap(bs); - if (ret == -ENOMEM) { - goto fail; - } - need_check = need_check || ret < 0; /* These are correctable errors */ + ret = parallels_fill_used_bitmap(bs); + if (ret == -ENOMEM) { + goto fail; } + need_check = need_check || ret < 0; /* These are correctable errors */ /* * We don't repair the image here if it's opened for checks. Also we don't