[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/2] qcow2-bitmaps: fix qcow2_can_store_new_dirty_bitmap
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [PATCH v2 1/2] qcow2-bitmaps: fix qcow2_can_store_new_dirty_bitmap |
Date: |
Fri, 25 Oct 2019 12:56:07 +0000 |
25.10.2019 15:50, Max Reitz wrote:
> On 14.10.19 13:51, Vladimir Sementsov-Ogievskiy wrote:
>> qcow2_can_store_new_dirty_bitmap works wrong, as it considers only
>> bitmaps already stored in the qcow2 image and ignores persistent
>> BdrvDirtyBitmap objects.
>>
>> So, let's instead count persistent BdrvDirtyBitmaps. We load all qcow2
>> bitmaps on open, so there should not be any bitmap in the image for
>> which we don't have BdrvDirtyBitmaps version. If it is - it's a kind of
>> corruption, and no reason to check for corruptions here (open() and
>> close() are better places for it).
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
>> ---
>> block/qcow2-bitmap.c | 41 ++++++++++++++++++-----------------------
>> 1 file changed, 18 insertions(+), 23 deletions(-)
>
> Am I right in interpreting qcow2_load_dirty_bitmaps() in such a way that
> every persistent dirty bitmap will cause a runtime dirty bitmap to be
> created?
Yes, we load all the bitmaps.
Every bitmap stored in qcow2 image is loaded and corresponding BdrvDirtyBitmap
is created. If bitmap has IN_USE flag in the image, created BdrvDirtyBitmap is
marked inconsistent, but it is still there. If bitmap doesn't have AUTO flag,
it becomes disabled bitmap.
>
> If so:
>
> Reviewed-by: Max Reitz <address@hidden>
>
--
Best regards,
Vladimir