From nobody Fri Nov 14 20:28:52 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1590516898; cv=none; d=zohomail.com; s=zohoarc; b=IQtMJ8MjopfSh+bNHDb1Q0U7zBHhZb7gni4EahS6VivHSPrDuXaihSFpNAUYaPdWislOSUOQ0x8AAOYtEcUnqLCJ9nxm+BOEpllMhlXS4vLBIrfiq8jyYAh30eRUccjSREndZ5DFPEi7zbwkV8y4WhwCOMj5wiIEbEZjMP9BWfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590516898; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=qQC0yeJaB/jhJFStZllogutaM5WO4YnaaXCXH31/EGQ=; b=gpsHG93abrJHjMhXgnCtVf449q82u0AeDHyAYPvx2N1xriCaeEFiazL8bSh4DW/dmXOr+q53hTDvKVU2M+iUWDAjj7Acf23kZbu8I/kJ1DsV1GeRKjpQSnSke9DoxIFaXpToVSTqv56mOvuR179pHB/hLILcVTu3llyx1K8ubN8= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590516898500694.5380583917191; Tue, 26 May 2020 11:14:58 -0700 (PDT) Received: from localhost ([::1]:36286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jde6K-0003qG-Fp for importer@patchew.org; Tue, 26 May 2020 14:14:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jde5N-0003LW-Gy; Tue, 26 May 2020 14:13:57 -0400 Received: from relay.sw.ru ([185.231.240.75]:44406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jde5L-0002Gb-CR; Tue, 26 May 2020 14:13:56 -0400 Received: from [192.168.15.5] (helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1jde5D-000317-Vm; Tue, 26 May 2020 21:13:48 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH] block/block-copy: block_copy_dirty_clusters: fix failure check Date: Tue, 26 May 2020 21:13:47 +0300 Message-Id: <20200526181347.489557-1-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 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=185.231.240.75; envelope-from=vsementsov@virtuozzo.com; helo=relay.sw.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/26 14:13:51 X-ACL-Warn: Detected OS = Linux 3.1-3.10 X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" ret may be > 0 on success path at this point. Fix assertion, which may crash currently. Fixes: 4ce5dd3e9b5ee0fac18625860eb3727399ee965e Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/block-copy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/block-copy.c b/block/block-copy.c index bb8d0569f2..f7428a7c08 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -622,8 +622,10 @@ out: * block_copy_task_run. If it fails, it means some task already fa= iled * for real reason, let's return first failure. * Still, assert that we don't rewrite failure by success. + * + * Note: ret may be positive here because of block-status result. */ - assert(ret =3D=3D 0 || aio_task_pool_status(aio) < 0); + assert(ret >=3D 0 || aio_task_pool_status(aio) < 0); ret =3D aio_task_pool_status(aio); =20 aio_task_pool_free(aio); --=20 2.18.0