[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Bug 1362635] [NEW] bdrv_read co-routine re-entered recursi
From: |
senya |
Subject: |
[Qemu-devel] [Bug 1362635] [NEW] bdrv_read co-routine re-entered recursively |
Date: |
Thu, 28 Aug 2014 14:19:04 -0000 |
Public bug reported:
calling bdrv_read in a loop leads to the follwing situation:
bs->drv->bdrv_aio_readv is called, and finally calls bdrv_co_io_em_complete in
other thread context.
there is a possibility of calling bdrv_co_io_em_complete before calling
qemu_coroutine_yield in bdrv_co_io_em. And qemu fails with "co-routine
re-entered recursively".
static void bdrv_co_io_em_complete(void *opaque, int ret)
{
CoroutineIOCompletion *co = opaque;
co->ret = ret;
qemu_coroutine_enter(co->coroutine, NULL);
}
static int coroutine_fn bdrv_co_io_em(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, QEMUIOVector *iov,
bool is_write)
{
CoroutineIOCompletion co = {
.coroutine = qemu_coroutine_self(),
};
BlockDriverAIOCB *acb;
if (is_write) {
acb = bs->drv->bdrv_aio_writev(bs, sector_num, iov, nb_sectors,
bdrv_co_io_em_complete, &co);
} else {
acb = bs->drv->bdrv_aio_readv(bs, sector_num, iov, nb_sectors,
bdrv_co_io_em_complete, &co);
}
trace_bdrv_co_io_em(bs, sector_num, nb_sectors, is_write, acb);
if (!acb) {
return -EIO;
}
qemu_coroutine_yield();
return co.ret;
}
is it a bug, or may be I don't understand something?
** Affects: qemu
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1362635
Title:
bdrv_read co-routine re-entered recursively
Status in QEMU:
New
Bug description:
calling bdrv_read in a loop leads to the follwing situation:
bs->drv->bdrv_aio_readv is called, and finally calls bdrv_co_io_em_complete
in other thread context.
there is a possibility of calling bdrv_co_io_em_complete before calling
qemu_coroutine_yield in bdrv_co_io_em. And qemu fails with "co-routine
re-entered recursively".
static void bdrv_co_io_em_complete(void *opaque, int ret)
{
CoroutineIOCompletion *co = opaque;
co->ret = ret;
qemu_coroutine_enter(co->coroutine, NULL);
}
static int coroutine_fn bdrv_co_io_em(BlockDriverState *bs, int64_t
sector_num,
int nb_sectors, QEMUIOVector *iov,
bool is_write)
{
CoroutineIOCompletion co = {
.coroutine = qemu_coroutine_self(),
};
BlockDriverAIOCB *acb;
if (is_write) {
acb = bs->drv->bdrv_aio_writev(bs, sector_num, iov, nb_sectors,
bdrv_co_io_em_complete, &co);
} else {
acb = bs->drv->bdrv_aio_readv(bs, sector_num, iov, nb_sectors,
bdrv_co_io_em_complete, &co);
}
trace_bdrv_co_io_em(bs, sector_num, nb_sectors, is_write, acb);
if (!acb) {
return -EIO;
}
qemu_coroutine_yield();
return co.ret;
}
is it a bug, or may be I don't understand something?
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1362635/+subscriptions
- [Qemu-devel] [PATCH 00/10] Implement ARM architectural watchpoints, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 09/10] target-arm: Remove comment about MDSCR_EL1 being dummy implementation, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 10/10] target-arm: Implement minimal DBGVCR, OSDLR_EL1, MDCCSR_EL0, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 05/10] target-arm: Implement setting of watchpoints, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 03/10] exec.c: Record watchpoint fault address and direction, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 06/10] target-arm: Move extended_addresses_enabled() to internals.h, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 08/10] target-arm: Set DBGDSCR.MOE for debug exceptions taken to AArch32, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 01/10] exec.c: Relax restrictions on watchpoint length and alignment, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 07/10] target-arm: Implement handling of fired watchpoints, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 02/10] exec.c: Provide full set of dummy wp remove functions in user-mode, Peter Maydell, 2014/08/29
- [Qemu-devel] [PATCH 04/10] cpu-exec: Make debug_excp_handler a QOM CPU method, Peter Maydell, 2014/08/29