Home
last modified time | relevance | path

Searched hist:aef4acb6 (Results 1 – 1 of 1) sorted by relevance

/qemu/block/
H A Dqcow2-cluster.caef4acb6 Wed Nov 30 12:23:41 GMT 2011 Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> qcow2: avoid reentrant bdrv_read() in copy_sectors()

A BlockDriverState should not issue requests on itself through the
public block layer interface. Nested, or reentrant, requests are
problematic because they do I/O throttling and request tracking twice.

Features like block layer copy-on-read use request tracking to avoid
race conditions between concurrent requests. The reentrant request will
have to "wait" for its parent request to complete. But the parent is
waiting for the reentrant request to make progress so we have reached
deadlock.

The solution is for block drivers to avoid the public block layer
interfaces for reentrant requests. Instead they should call their own
internal functions if they wish to perform reentrant requests.

This is also a good opportunity to make copy_sectors() a true
coroutine_fn. That means calling bdrv_co_writev() instead of
bdrv_write(). Behavior is unchanged but we're being explicit that this
executes in coroutine context.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>