[PATCH 0/2] mirror: Fix hang (operation waiting for itself/circular dependency)

Kevin Wolf posted 2 patches 2 weeks ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200325172326.22347-1-kwolf@redhat.com
Maintainers: Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>
block/mirror.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)

[PATCH 0/2] mirror: Fix hang (operation waiting for itself/circular dependency)

Posted by Kevin Wolf 2 weeks ago
The recent fix didn't actually fix the whole problem. Operations can't
only wait for themselves, but we can also end up with circular
dependencies like two operations waiting for each other to complete.

This reverts the first fix and implements another approach.

Kevin Wolf (2):
  Revert "mirror: Don't let an operation wait for itself"
  mirror: Wait only for in-flight operations

 block/mirror.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

-- 
2.20.1


Re: [PATCH 0/2] mirror: Fix hang (operation waiting for itself/circular dependency)

Posted by Kevin Wolf 2 weeks ago
Am 25.03.2020 um 18:23 hat Kevin Wolf geschrieben:
> The recent fix didn't actually fix the whole problem. Operations can't
> only wait for themselves, but we can also end up with circular
> dependencies like two operations waiting for each other to complete.
> 
> This reverts the first fix and implements another approach.

Hm, somehow this seems to break iotests 151. I don't actually understand
the backtrace, because that's during job initialisation, so my changes
shouldn't have had any effect yet:

(gdb) bt
#0  0x00007fba6d85057f in raise () at /lib64/libc.so.6
#1  0x00007fba6d83a895 in abort () at /lib64/libc.so.6
#2  0x00005624d94d109a in bitmap_new (nbits=<optimized out>) at /home/kwolf/source/qemu/include/qemu/bitmap.h:103
#3  0x00005624d94d109a in mirror_run (job=0x5624dc8d5560, errp=<optimized out>) at block/mirror.c:922
#4  0x00005624d988053f in job_co_entry (opaque=0x5624dc8d5560) at job.c:878
#5  0x00005624d998d3bb in coroutine_trampoline (i0=<optimized out>, i1=<optimized out>) at util/coroutine-ucontext.c:115
#6  0x00007fba6d866250 in __start_context () at /lib64/libc.so.6
#7  0x00007fffa2d48130 in  ()
#8  0x0000000000000000 in  ()

Something to check tomorrow.

Kevin