block/mirror: fix active mirror dead-lock in mirror_wait_on_conflicts
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fri, 2 Jul 2021 21:16:36 +0000 (00:16 +0300)
committerKevin Wolf <kwolf@redhat.com>
Tue, 20 Jul 2021 11:14:45 +0000 (13:14 +0200)
commitd44dae1a7cf782ec9235746ebb0e6c1a20dd7288
treeca473538c698f1375c84a3eb9968f9d0d6eb508e
parente0f69d83d5c5c039b133b60b5a7130dedeeaca42
block/mirror: fix active mirror dead-lock in mirror_wait_on_conflicts

It's possible that requests start to wait each other in
mirror_wait_on_conflicts(). To avoid it let's use same technique as in
block/io.c in bdrv_wait_serialising_requests_locked() /
bdrv_find_conflicting_request(): don't wait on intersecting request if
it is already waiting for some other request.

For details of the dead-lock look at testIntersectingActiveIO()
test-case which we actually fixing now.

Fixes: d06107ade0ce74dc39739bac80de84b51ec18546
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210702211636.228981-4-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c
tests/qemu-iotests/151