On 01/04/2016 05:27 AM, Fam Zheng wrote:
> This makes sure we don't leak a dirty bitmap in any case.
> 
> Signed-off-by: Fam Zheng <f...@redhat.com>
> ---
>  block/dirty-bitmap.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
> index 9cac794..60ee965 100644
> --- a/block/dirty-bitmap.c
> +++ b/block/dirty-bitmap.c
> @@ -297,6 +297,7 @@ void bdrv_release_dirty_bitmap(BlockDriverState *bs, 
> BdrvDirtyBitmap *bitmap)
>              return;
>          }
>      }
> +    abort();
>  }
>  
>  void bdrv_disable_dirty_bitmap(BdrvDirtyBitmap *bitmap)
> 

Before this patch: release can be called on a (BDS, BITMAP) pair in
cases where the bitmap does not belong to the BDS and this function just
ignored it.

After this patch: We abort() in cases where we get this pairing incorrect.

I don't think there is any reason to ever get this wrong on a call to
this function, so this is alright.

Reviewed-by: John Snow <js...@redhat.com>

Reply via email to