[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 06/20] parallels: Recreate used bitmap in parallels_check_leak
From: |
Alexander Ivanov |
Subject: |
[PATCH v2 06/20] parallels: Recreate used bitmap in parallels_check_leak() |
Date: |
Thu, 19 Oct 2023 14:58:40 +0200 |
In parallels_check_leak() file can be truncated. In this case the used
bitmap would not comply to the file. Recreate the bitmap after file
truncation.
Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
block/parallels.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/block/parallels.c b/block/parallels.c
index ba9fc46279..dad2bf67cf 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -807,6 +807,14 @@ parallels_check_leak(BlockDriverState *bs, BdrvCheckResult
*res,
return ret;
}
s->data_end = res->image_end_offset >> BDRV_SECTOR_BITS;
+
+ parallels_free_used_bitmap(bs);
+ ret = parallels_fill_used_bitmap(bs);
+ if (ret == -ENOMEM) {
+ res->check_errors++;
+ return ret;
+ }
+
if (explicit) {
res->leaks_fixed += count;
}
--
2.34.1
- [PATCH v2 00/20] parallels: Add full dirty bitmap support, Alexander Ivanov, 2023/10/19
- [PATCH v2 02/20] parallels: Move inactivation code to a separate function, Alexander Ivanov, 2023/10/19
- [PATCH v2 01/20] parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap(), Alexander Ivanov, 2023/10/19
- [PATCH v2 03/20] parallels: Add mark_unused() helper, Alexander Ivanov, 2023/10/19
- [PATCH v2 04/20] parallels: Move host clusters allocation to a separate function, Alexander Ivanov, 2023/10/19
- [PATCH v2 06/20] parallels: Recreate used bitmap in parallels_check_leak(),
Alexander Ivanov <=
- [PATCH v2 08/20] parallels: Create used bitmap even if checks needed, Alexander Ivanov, 2023/10/19
- [PATCH v2 10/20] parallels: Add dirty bitmaps saving, Alexander Ivanov, 2023/10/19
- [PATCH v2 05/20] parallels: Set data_end value in parallels_check_leak(), Alexander Ivanov, 2023/10/19
- [PATCH v2 07/20] parallels: Add a note about used bitmap in parallels_check_duplicate(), Alexander Ivanov, 2023/10/19
- [PATCH v2 09/20] parallels: Make mark_used() and mark_unused() global functions, Alexander Ivanov, 2023/10/19
- [PATCH v2 12/20] parallels: Handle L1 entries equal to one, Alexander Ivanov, 2023/10/19