[Qemu-devel] [PATCH] block/qcow2-bitmap: fix free_bitmap_clusters

Vladimir Sementsov-Ogievskiy posted 1 patch 7 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180608101225.2575-1-vsementsov@virtuozzo.com
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
block/qcow2-bitmap.c | 1 -
1 file changed, 1 deletion(-)
[Qemu-devel] [PATCH] block/qcow2-bitmap: fix free_bitmap_clusters
Posted by Vladimir Sementsov-Ogievskiy 7 years, 4 months ago
This assert may fail, because bitmap_table is not initialized. Just
drop it, as it's obvious, that bitmap_table_load sets bitmap_table
parameter only when returning zero.

Reported-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/qcow2-bitmap.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 60d5290f10..69485aa1de 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -254,7 +254,6 @@ static int free_bitmap_clusters(BlockDriverState *bs, Qcow2BitmapTable *tb)
 
     ret = bitmap_table_load(bs, tb, &bitmap_table);
     if (ret < 0) {
-        assert(bitmap_table == NULL);
         return ret;
     }
 
-- 
2.11.1


Re: [Qemu-devel] [PATCH] block/qcow2-bitmap: fix free_bitmap_clusters
Posted by Max Reitz 7 years, 4 months ago
On 2018-06-08 12:12, Vladimir Sementsov-Ogievskiy wrote:
> This assert may fail, because bitmap_table is not initialized. Just
> drop it, as it's obvious, that bitmap_table_load sets bitmap_table
> parameter only when returning zero.
> 
> Reported-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>  block/qcow2-bitmap.c | 1 -
>  1 file changed, 1 deletion(-)

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block

Max