From patchwork Thu Aug 25 14:31:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivanov X-Patchwork-Id: 12954942 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 3CA4BC64990 for ; Thu, 25 Aug 2022 14:41:37 +0000 (UTC) Received: from localhost ([::1]:35850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRE36-0002wh-3D for qemu-devel@archiver.kernel.org; Thu, 25 Aug 2022 10:41:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRDtV-0000aA-3V; Thu, 25 Aug 2022 10:31:41 -0400 Received: from mail-vi1eur05on2096.outbound.protection.outlook.com ([40.107.21.96]:43230 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 1oRDtT-0004oG-Gz; Thu, 25 Aug 2022 10:31:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RMBSn2F4s683ebM3GS6FDpd9OmYyYzDDjenPZ8a1clBbvIx+huVug9Gy8KkCrll5v/g8mTU8ClStVD5jOSuPsdCJDZ8gqq+AN2YJL4ncuJHhVWhB76zr6yNBDIEY9zEhsc4ktwC5/o6iV77uIDOLz6gJ7Jso88UtkUrch8Ioy4TB9eZRZr8IkoR0aUGsMgrxYlHbQfeBn+x+lCtKy/qU2HvaZaf8o5sugpB+N35IyY+ntI6KItBbCLmoBbM5ud/2rScEN2IeviPYNOC+JtPgjQQqlptj2hr/wj34HX6H3anZuRIookOvEsFYnnIZuk5qtJFZEjPd3HJm1xnFAAzorw== 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=yk9li7uTihtYm0CYbs5JOYbF9rA4KmKM2Fs2RDAdLcY=; b=HBwXARMkPBjFRfKBfMZT/anu/DFcV8GVCN6WR8slrxgdep8RaeepPcyO+WzySw8+vD4r5ka5qLcxuc5HYNhnFCATy9tEBXc7q5j46lly1PMNqEC5UyfauesuO9YR3N4p4s+TcLSaKCy47XqUru4Fc40Zkmlb9om0SNDcPnNWdvQL4i8Ik7pfjBy/AOSgbio+uUtWWT59ypD6thqk+P+yAiPrNXupdxyJ9XJiB5iQ4uahAdutiMwi2ZHVbM6KMByNhTzS75JQOgLxAOtoYvAbWXEav55YtkCoL14PLT/fYZ3Y+b70u3Z+jC2bbb7MhPwiPQzuNs0usjgHE/RZpU2jjQ== 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=yk9li7uTihtYm0CYbs5JOYbF9rA4KmKM2Fs2RDAdLcY=; b=MtdiaVO3hxbLzmCDn5zjyPsL5JV5aOqNTC0s7uIYLnqr/8xmQjdZ7q79H3eXoVRUutJeOnb/gaAN1QoU1YsIhXZLfF0y++35rKwfFSOp46RCXWTyQDjFqntTWmJBDcYjq5/7nKq2nfjGftlGBtLpuLJbtniK+mbjaC5SYQ95SQxsljM5YKzCFYYxWsj7AFUWB8dvZBRf023NK23YywXN6zP085Rx/GMZGptt6R43eob6/AZbbyCixKuc/tCBy54QGBgkvksknqPSX6eEPlQ/AF4+TddlUHOxNwjuXRf7uUQ6Dp7aaO7F289e8mSM595i/7LsgHrkl4sD5sDr0eusLw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AS8PR08MB7095.eurprd08.prod.outlook.com (2603:10a6:20b:402::11) by HE1PR0802MB2298.eurprd08.prod.outlook.com (2603:10a6:3:c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Thu, 25 Aug 2022 14:31:18 +0000 Received: from AS8PR08MB7095.eurprd08.prod.outlook.com ([fe80::5174:25c7:6df8:741b]) by AS8PR08MB7095.eurprd08.prod.outlook.com ([fe80::5174:25c7:6df8:741b%5]) with mapi id 15.20.5566.015; Thu, 25 Aug 2022 14:31:18 +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 v6 02/10] parallels: Fix high_off calculation in parallels_co_check() Date: Thu, 25 Aug 2022 16:31:01 +0200 Message-Id: <20220825143109.176582-3-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220825143109.176582-1-alexander.ivanov@virtuozzo.com> References: <20220825143109.176582-1-alexander.ivanov@virtuozzo.com> X-ClientProxiedBy: AS9PR05CA0046.eurprd05.prod.outlook.com (2603:10a6:20b:489::29) To AS8PR08MB7095.eurprd08.prod.outlook.com (2603:10a6:20b:402::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6392704e-b374-471e-1842-08da86a67940 X-MS-TrafficTypeDiagnostic: HE1PR0802MB2298:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kPcvRTAShXKOcZCueBJxrBpuTMeaktSFGbHYpTCJdve++wUDqxkYwDX3l+STjLuH0f8hqazETCacVZ20mfTqimlA1M/WD8Q1IAE2cFN4LxEACGR8Inw33odZvvRBKGYFIk2wygGNrs3hXU4zJ/Zm5ryC5W/EpwekZepVwtxuY3DA3HxYlq6tmmFB22Kb8QmkmhtwT2ixIJscxppSP7Xmj0J1yCCFT4tKQ27Gt2StB1xXvz7LuSTk+/yZBdQ6MQ+Tehmi2wlNrvV3E5+TDHYTBeX3KHC4Mm5NLNjVIRkuHBCDmlRhwpmr964UqR2Z2mzAHtHaYA6bq4q4nj/NSbI0X09sVxWgW9J2yX80zOtxZVQxIFHrWq8yqPBGDwRrlfKpmikBk12lebklI3RHaxQLacC/sxoo9CLYs8a15f7l90sxG1ejpPEX5TMjJHrC6HE4WLIzh+UA+AlNPkI4T2EN5GDuysGvrxxyqyx9tfulYvmooKNY/E4oAhHaiqm1T9q93NjCh8gStNdL3h9LK7C/wttgD1HyPr9pEJExidhcGf1q9IHeERWhIXOPxVmWKFH018rWncoEffRTAUwsWAB1zuBhOaDzJbEV/+W1rHy00C0BH+64vyKXNiZBtN9HPHhcJhX17ov6eAd18Efi2kS9dNha10lu4gb5GoCHiR2w2N678vuoC1Hr7jvt/7IEAYhzkLC8JuarRIUqWly/qDjy1b11EyncQsQfpimClSKEkZ5L0A2oAl0fQS0s6TBBnvUCC6PwHWhcsW5wmo6WKc9+/w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB7095.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(39850400004)(376002)(366004)(396003)(136003)(346002)(36756003)(83380400001)(4744005)(186003)(1076003)(2616005)(6506007)(6512007)(5660300002)(52116002)(2906002)(26005)(44832011)(478600001)(38100700002)(38350700002)(8676002)(6916009)(316002)(66946007)(4326008)(86362001)(66556008)(6666004)(66476007)(8936002)(6486002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xCMB8l77BkHqpdB5/OqrXAbNr1Z2utSiVwxpsmH6HCOJcgHOP7fc+Qtca50O/snNtxqHFtWua3zDqkw7EQnF/mlZMxWAnDQcGycwC+O4XujD6PMnSqUvYJavWLopcs7W1JLqAGILlULTg3Yip4+6K7/aNXUCZ7SS8wTTCSXV8vj+Ob+xWdYQV1lSqDnHIvmMA1wrJMbK1mZN92PhsMm0Ur+YYrBevtMcMckveDS+FZD94Z12RdARdc7QFjO9ScEt1D9BOwxqNYJW5favmZc/FbKhMS6iHX2qr47oDXP6LnLywUaLui4SIqdRfzAb6nvBAcwFRFjYdYBmT0hUlAbEetSHtJKYimlUEHhXSUvJY0/fHGEm8CLxosUYaG+CRW52TVGLQ9MiFI8Baa/DdY6fSjjajBNcV+lIu0LMUaSh+HWmpZ8j51JATHPiBJYn/NAnmbNvurwULFDn0lMS50BUBn5bMgtqYTwSS+Ph09HRwZeHAyxxbI+FE3s/TaF7FyRiDazNJD+QF2GMCU0iWPzeFuUkEMPRGyTynGCO1yzx/mFTLsdG9I0foZ30pgANDwEdI8tP5b19thwi++vzPBc+vpucLGYD9hIozBseoO1ZedKNpE65Zo7ZG/MhyIYs+V8LgLZobDni7dP1EcmEuz6cdS+j0pfIiNPDuFQZLcnkAutST0PYXNmGjYwAwyHWNMDS1fnQ4vpQf5QJ+s/QSa4bDL84Z7CSszFoX8NJW6cdxH1GGC4qpVKdHGqrFikMuwZkMqsG0ybwdsdW2vGc5xpC6F0Asw7E5OaQS7TeVlMBvB4PIgFFbevlz1C4Jdc5YKkJNSpOOtYMa9UEKZRt1ODsHq7r/NKkaNm80jr8z+IpfmpfAzxcfjXoGsJOBDIsj45Kne5rBLk9sP+Cl8AKfPfTPT3L0fSMVoZe0M8KPV3IXzUza5h1+e+LmL6FGxpbTu2WZ6nynlzXHz3JstABjbqYdmihm+Td7KNK+Vhxfq+JBXNRFnZZhmL7+mUO9dnxss7aTn3RVOq9lxffl1mMQJgO5TELypwsYws4U5LSR7eYuvpkB/EXSZb8FVYtlJGK7zbIFNl84wKwu92jRWOqUMRFSYCAKezUN2DwN74YI75t5SdzhzAMOIc/ETh2PPa4nTJhimcv5L0kXlpoqZmZqynIC/o12bNe1DLLTzUd45sHBpKkZ+tY9SDcz2AgDVTGDCtTs+TLMnx1JmrKgv3Yua3X6CI82T8K0lJp7T7vxDiEuH/8lfiz+2kVUBNlPUNAJNHFc+YWSG76KX8ZurGPlu5VhIWKmQ9bA3wZFwsv0K0Ol+vteIUiAfJwLeaAyQNeVF7Qfii++tSjtuSpFUf40qQ5F3MBdsBAD83P09dfawgoAlz8aVEuSuGx0Im4UcsFr3RSnsA9RRs384zb1RzoV1S+jx0yrao2p6L1wEUJYmaPEG1SDjYjN78nXiLAR4jeGVGcKgP5y48Qwq3qyPFZWzc4KMxDGIG3TqhH2MbLEcgnjDcHyatMIDz4MgT8gdEvJXsHYRUck41NpP7kS+2n+zDpIpe0n0eKR240K+XQUm/cYvUtm/Xen/XDzcrVXQDDZrEuTu55c9QZalEVIS2hXfpG7rIhWfVbZf68HwS6qfhL50I= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6392704e-b374-471e-1842-08da86a67940 X-MS-Exchange-CrossTenant-AuthSource: AS8PR08MB7095.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2022 14:31:18.4533 (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: t5YJQPAkF6Ih7y0PhD9Pw0gqigV2G+p4Ju/M0WbjA0yDwN9NmLeoPX7IzMeHijjC9+26eklusc6eOmQFxTjFqAqeNjlO/CnlVwONw71T8bs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2298 Received-SPF: pass client-ip=40.107.21.96; 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, RCVD_IN_MSPIKE_H2=-0.001, 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" Don't let high_off be more than the file size even if we don't fix the image. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 93bc2750ef..7e8cdbbc3a 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -460,12 +460,12 @@ static int coroutine_fn parallels_co_check(BlockDriverState *bs, fix & BDRV_FIX_ERRORS ? "Repairing" : "ERROR", i); res->corruptions++; if (fix & BDRV_FIX_ERRORS) { - prev_off = 0; s->bat_bitmap[i] = 0; res->corruptions_fixed++; flush_bat = true; - continue; } + prev_off = 0; + continue; } res->bfi.allocated_clusters++;