[PATCH v2 0/3] block/io: serialising request clean up and locking fix

Paolo Bonzini posted 3 patches 4 years, 3 months ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test asan failed
Test checkpatch passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1578495356-46219-1-git-send-email-pbonzini@redhat.com
Maintainers: Stefan Hajnoczi <stefanha@redhat.com>, Max Reitz <mreitz@redhat.com>, Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>
block/file-posix.c        |   1 -
block/io.c                | 162 +++++++++++++++++++++++-----------------------
include/block/block.h     |  12 ----
include/block/block_int.h |   3 +-
4 files changed, 81 insertions(+), 97 deletions(-)
[PATCH v2 0/3] block/io: serialising request clean up and locking fix
Posted by Paolo Bonzini 4 years, 3 months ago
Peter Lieven noticed that reqs->overlap_offset and reqs->overlap_bytes
are written outside bs->reqs_lock.  Patch 3 fixes it, while patches 1
and 2 are preparatory cleanups.

v1->v2: fix comment in patch 2, commit message in patch 3 [Kevin]

Paolo Bonzini (3):
  block: eliminate BDRV_REQ_NO_SERIALISING
  block/io: wait for serialising requests when a request becomes
    serialising
  block/io: take bs->reqs_lock in bdrv_mark_request_serialising

 block/file-posix.c        |   1 -
 block/io.c                | 162 +++++++++++++++++++++++-----------------------
 include/block/block.h     |  12 ----
 include/block/block_int.h |   3 +-
 4 files changed, 81 insertions(+), 97 deletions(-)

-- 
1.8.3.1


Re: [PATCH v2 0/3] block/io: serialising request clean up and locking fix
Posted by Stefan Hajnoczi 4 years, 3 months ago
On Wed, Jan 08, 2020 at 03:55:53PM +0100, Paolo Bonzini wrote:
> Peter Lieven noticed that reqs->overlap_offset and reqs->overlap_bytes
> are written outside bs->reqs_lock.  Patch 3 fixes it, while patches 1
> and 2 are preparatory cleanups.
> 
> v1->v2: fix comment in patch 2, commit message in patch 3 [Kevin]
> 
> Paolo Bonzini (3):
>   block: eliminate BDRV_REQ_NO_SERIALISING
>   block/io: wait for serialising requests when a request becomes
>     serialising
>   block/io: take bs->reqs_lock in bdrv_mark_request_serialising
> 
>  block/file-posix.c        |   1 -
>  block/io.c                | 162 +++++++++++++++++++++++-----------------------
>  include/block/block.h     |  12 ----
>  include/block/block_int.h |   3 +-
>  4 files changed, 81 insertions(+), 97 deletions(-)

Is it possible to trigger the bug somehow?

Can you implement a test case?

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan
Re: [PATCH v2 0/3] block/io: serialising request clean up and locking fix
Posted by Paolo Bonzini 4 years, 3 months ago
On 14/01/20 17:28, Stefan Hajnoczi wrote:
> On Wed, Jan 08, 2020 at 03:55:53PM +0100, Paolo Bonzini wrote:
>> Peter Lieven noticed that reqs->overlap_offset and reqs->overlap_bytes
>> are written outside bs->reqs_lock.  Patch 3 fixes it, while patches 1
>> and 2 are preparatory cleanups.
>>
>> v1->v2: fix comment in patch 2, commit message in patch 3 [Kevin]
>>
>> Paolo Bonzini (3):
>>   block: eliminate BDRV_REQ_NO_SERIALISING
>>   block/io: wait for serialising requests when a request becomes
>>     serialising
>>   block/io: take bs->reqs_lock in bdrv_mark_request_serialising
>>
>>  block/file-posix.c        |   1 -
>>  block/io.c                | 162 +++++++++++++++++++++++-----------------------
>>  include/block/block.h     |  12 ----
>>  include/block/block_int.h |   3 +-
>>  4 files changed, 81 insertions(+), 97 deletions(-)
> Is it possible to trigger the bug somehow?
> 
> Can you implement a test case?

No, it was found by inspection only, and it's actually protected by the
AioContext lock for now.

Paolo