[PATCH v3 0/3] block/dirty-bitmaps: fix and improve bitmap merge

Vladimir Sementsov-Ogievskiy posted 3 patches 3 years, 10 months ago
Failed in applying to current master (apply log)
Maintainers: John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Eric Blake <eblake@redhat.com>
There is a newer version of this series
include/block/block_int-io.h    |  2 +-
include/qemu/hbitmap.h          | 15 ++-----------
block/backup.c                  |  6 ++----
block/dirty-bitmap.c            | 26 ++++++++++------------
block/monitor/bitmap-qmp-cmds.c | 38 +++++++++++++++++----------------
util/hbitmap.c                  | 25 ++++++----------------
6 files changed, 43 insertions(+), 69 deletions(-)
[PATCH v3 0/3] block/dirty-bitmaps: fix and improve bitmap merge
Posted by Vladimir Sementsov-Ogievskiy 3 years, 10 months ago
v3: rebase on master, one patch is already merged.

Vladimir Sementsov-Ogievskiy (3):
  block: block_dirty_bitmap_merge(): fix error path
  block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap
  block: simplify handling of try to merge different sized bitmaps

 include/block/block_int-io.h    |  2 +-
 include/qemu/hbitmap.h          | 15 ++-----------
 block/backup.c                  |  6 ++----
 block/dirty-bitmap.c            | 26 ++++++++++------------
 block/monitor/bitmap-qmp-cmds.c | 38 +++++++++++++++++----------------
 util/hbitmap.c                  | 25 ++++++----------------
 6 files changed, 43 insertions(+), 69 deletions(-)

-- 
2.35.1
Re: [PATCH v3 0/3] block/dirty-bitmaps: fix and improve bitmap merge
Posted by Eric Blake 3 years, 10 months ago
On Fri, Apr 01, 2022 at 01:08:01PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> v3: rebase on master, one patch is already merged.
> 
> Vladimir Sementsov-Ogievskiy (3):
>   block: block_dirty_bitmap_merge(): fix error path
>   block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap
>   block: simplify handling of try to merge different sized bitmaps

Is any of this series worth getting into 7.0, or are we safe letting
it slide to 7.1?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Re: [PATCH v3 0/3] block/dirty-bitmaps: fix and improve bitmap merge
Posted by Vladimir Sementsov-Ogievskiy 3 years, 10 months ago
01.04.2022 23:17, Eric Blake wrote:
> On Fri, Apr 01, 2022 at 01:08:01PM +0300, Vladimir Sementsov-Ogievskiy wrote:
>> v3: rebase on master, one patch is already merged.
>>
>> Vladimir Sementsov-Ogievskiy (3):
>>    block: block_dirty_bitmap_merge(): fix error path
>>    block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap
>>    block: simplify handling of try to merge different sized bitmaps
> 
> Is any of this series worth getting into 7.0, or are we safe letting
> it slide to 7.1?
> 

Let's check.

Only first patch is a fix.

anon bitmap is created on same bs where dst is found, so they should be compatible in size.

But bdrv_merge_dirty_bitmap also do some checks on dst status, which may actually fail..

So, in bad case we set errp, but return non-NULL dst bitmap.

Look at callers of block_dirty_bitmap_merge:

1. qmp_block_dirty_bitmap_merge() is OK, it ignores return value.

2. qmp_transaction use local_err to detect error, so we'll go through error path, that's good. state->bitmap is set, but it's not really matter. What makes sense is state->backup set or not?

state->backup is initialized with zero, as qmp_transaction() use g_malloc0 to allocate state buffer.

And bdrv_merge_dirty_bitmap() will do all checks prior to call bdrv_dirty_bitmap_merge_internal(), which actually can set @backup. So, state->backup is not set in our bad case.

So that all should be OK to postpone for 7.1.

-- 
Best regards,
Vladimir
Re: [PATCH v3 0/3] block/dirty-bitmaps: fix and improve bitmap merge
Posted by Hanna Reitz 3 years, 10 months ago
On 01.04.22 12:08, Vladimir Sementsov-Ogievskiy wrote:
> v3: rebase on master, one patch is already merged.
>
> Vladimir Sementsov-Ogievskiy (3):
>    block: block_dirty_bitmap_merge(): fix error path
>    block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap
>    block: simplify handling of try to merge different sized bitmaps
>
>   include/block/block_int-io.h    |  2 +-
>   include/qemu/hbitmap.h          | 15 ++-----------
>   block/backup.c                  |  6 ++----
>   block/dirty-bitmap.c            | 26 ++++++++++------------
>   block/monitor/bitmap-qmp-cmds.c | 38 +++++++++++++++++----------------
>   util/hbitmap.c                  | 25 ++++++----------------
>   6 files changed, 43 insertions(+), 69 deletions(-)

Reviewed-by: Hanna Reitz <hreitz@redhat.com>