[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/22] hbitmap: fix hbitmap_status() return value for first dirty
From: |
Kevin Wolf |
Subject: |
[PULL 22/22] hbitmap: fix hbitmap_status() return value for first dirty bit case |
Date: |
Fri, 17 Feb 2023 16:09:54 +0100 |
From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
The last return statement should return true, as we already evaluated that
start == 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 <andrey.zhadchenko@virtuozzo.com>
Message-Id: <20230202181523.423131-1-andrey.zhadchenko@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
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);
/*
- * 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,
int64_t count,
assert(next_zero > start);
*pnum = next_zero - start;
- return false;
+ return true;
}
bool hbitmap_empty(const HBitmap *hb)
--
2.39.2
- [PULL 07/22] luks: Fix .bdrv_co_create(_opts) to open images with no_co_wrapper, (continued)
- [PULL 07/22] luks: Fix .bdrv_co_create(_opts) to open images with no_co_wrapper, Kevin Wolf, 2023/02/17
- [PULL 18/22] block: Handle curl 7.55.0, 7.85.0 version changes, Kevin Wolf, 2023/02/17
- [PULL 11/22] qed: Fix .bdrv_co_create(_opts) to open images with no_co_wrapper, Kevin Wolf, 2023/02/17
- [PULL 10/22] qcow2: Fix open/create to open images with no_co_wrapper, Kevin Wolf, 2023/02/17
- [PULL 19/22] block: temporarily hold the new AioContext of bs_top in bdrv_append(), Kevin Wolf, 2023/02/17
- [PULL 20/22] MAINTAINERS: drop Vladimir from parallels block driver, Kevin Wolf, 2023/02/17
- [PULL 21/22] block/file-posix: don't use functions calling AIO_WAIT_WHILE in worker threads, Kevin Wolf, 2023/02/17
- [PULL 15/22] vpc: Fix .bdrv_co_create(_opts) to open images with no_co_wrapper, Kevin Wolf, 2023/02/17
- [PULL 16/22] block: Fix bdrv_co_create_opts_simple() to open images with no_co_wrapper, Kevin Wolf, 2023/02/17
- [PULL 14/22] vmdk: Fix .bdrv_co_create(_opts) to open images with no_co_wrapper, Kevin Wolf, 2023/02/17
- [PULL 22/22] hbitmap: fix hbitmap_status() return value for first dirty bit case,
Kevin Wolf <=
- Re: [PULL 00/22] Block layer patches, Peter Maydell, 2023/02/20