From nobody Sat Apr 20 14:53:04 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1675361813; cv=none; d=zohomail.com; s=zohoarc; b=NoVTMYvsPoKGHVvHseD0piIvoUGMFDxDtEDKc7NTQr8L+mOulcyE7EzC0gW1hlBcK4mGodDm/z9Fu2dClJVkuQoQu9Pxebm66JtIBNdgpQzkEDu0wClnU+tciCoZrvGv2grMhDSLrWC6ldRMEldqWOnQ08efNT3fIL7vEk21UXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675361813; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=nMQzcYN1CwZVj2XL5+Pqmi++5lkRsQu7A7qxn4MhqoY=; b=QflFxGswPNsEPJDxQdOqxBUgqwV2x1MAaSTuiObNc6Ce+u1YDZbgScKUJ8mvsIba8gkZKeNgeiyIn637X/rOFD7dDzCpR74LxpFcshDn3LzaSKhHVehfgd2MOhcOlg4dVMAmQ7TAB3CnyAmcuER0fHVFIujIvCCHr9dU8Potiig= 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+importer2=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 1675361813724694.453670439279; Thu, 2 Feb 2023 10:16:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNe7j-0004Qf-2r; Thu, 02 Feb 2023 13:15:51 -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 1pNe7d-0004Pc-5M; Thu, 02 Feb 2023 13:15:48 -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 1pNe7a-0003S0-P3; Thu, 02 Feb 2023 13:15:44 -0500 Received: from dev006.ch-qa.sw.ru ([172.29.1.11]) by relay.virtuozzo.com with esmtp (Exim 4.95) (envelope-from ) id 1pNe7M-005EQg-1w; Thu, 02 Feb 2023 19:15:28 +0100 To: vsementsov@yandex-team.ru Cc: hreitz@redhat.com, eblake@redhat.com, jsnow@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH] hbitmap: fix hbitmap_status() return value for first dirty bit case Date: Thu, 2 Feb 2023 21:15:23 +0300 Message-Id: <20230202181523.423131-1-andrey.zhadchenko@virtuozzo.com> X-Mailer: git-send-email 2.31.1 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=130.117.225.111; envelope-from=andrey.zhadchenko@virtuozzo.com; helo=relay.virtuozzo.com 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_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: Andrey Zhadchenko From: Andrey Zhadchenko via Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZM-MESSAGEID: 1675361816010100001 Content-Type: text/plain; charset="utf-8" The last return statement should return true, as we already evaluated that start =3D=3D next_dirty Also, fix hbitmap_status() description in header Cc: qemu-stable@nongnu.org Fixes: a6426475a75 ("block/dirty-bitmap: introduce bdrv_dirty_bitmap_status= ()") Signed-off-by: Andrey Zhadchenko Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/qemu/hbitmap.h | 2 +- util/hbitmap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h index af4e4ab746..8136e33674 100644 --- a/include/qemu/hbitmap.h +++ b/include/qemu/hbitmap.h @@ -330,7 +330,7 @@ bool hbitmap_next_dirty_area(const HBitmap *hb, int64_t= start, int64_t end, int64_t *dirty_start, int64_t *dirty_count); =20 /* - * bdrv_dirty_bitmap_status: + * hbitmap_status: * @hb: The HBitmap to operate on * @start: The bit to start from * @count: Number of bits to proceed diff --git a/util/hbitmap.c b/util/hbitmap.c index 297db35fb1..6d6e1b595d 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -331,7 +331,7 @@ bool hbitmap_status(const HBitmap *hb, int64_t start, i= nt64_t count, =20 assert(next_zero > start); *pnum =3D next_zero - start; - return false; + return true; } =20 bool hbitmap_empty(const HBitmap *hb) --=20 2.36.1