[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/7] util/hbitmap: update orig_size on truncate
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PULL 3/7] util/hbitmap: update orig_size on truncate |
Date: |
Mon, 5 Aug 2019 18:37:36 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Without this, hbitmap_next_zero and hbitmap_next_dirty_area are broken
after truncate. So, orig_size is broken since it's introduction in
76d570dc495c56bb.
Fixes: 76d570dc495c56bb
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
util/hbitmap.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/util/hbitmap.c b/util/hbitmap.c
index 7905212a8b..bcc0acdc6a 100644
--- a/util/hbitmap.c
+++ b/util/hbitmap.c
@@ -53,7 +53,9 @@
*/
struct HBitmap {
- /* Size of the bitmap, as requested in hbitmap_alloc. */
+ /*
+ * Size of the bitmap, as requested in hbitmap_alloc or in
hbitmap_truncate.
+ */
uint64_t orig_size;
/* Number of total bits in the bottom level. */
@@ -732,6 +734,8 @@ void hbitmap_truncate(HBitmap *hb, uint64_t size)
uint64_t num_elements = size;
uint64_t old;
+ hb->orig_size = size;
+
/* Size comes in as logical elements, adjust for granularity. */
size = (size + (1ULL << hb->granularity) - 1) >> hb->granularity;
assert(size <= ((uint64_t)1 << HBITMAP_LOG_MAX_SIZE));
--
2.21.0
- [Qemu-devel] [PULL 0/7] Block patches for 4.1.0-rc4, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 1/7] backup: Copy only dirty areas, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 2/7] iotests: Test backup job with two guest writes, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 3/7] util/hbitmap: update orig_size on truncate,
Max Reitz <=
- [Qemu-devel] [PULL 4/7] iotests: Test incremental backup after truncation, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 5/7] mirror: Only mirror granularity-aligned chunks, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 6/7] iotests: Test unaligned blocking mirror write, Max Reitz, 2019/08/05
- [Qemu-devel] [PULL 7/7] block/backup: disable copy_range for compressed backup, Max Reitz, 2019/08/05
- Re: [Qemu-devel] [PULL 0/7] Block patches for 4.1.0-rc4, Vladimir Sementsov-Ogievskiy, 2019/08/05
Re: [Qemu-devel] [PULL 0/7] Block patches for 4.1.0-rc4, Peter Maydell, 2019/08/05