* [Qemu-devel] [PATCH] blockdbg: Fix Bottom Half deletion
@ 2011-05-27 9:46 Kevin Wolf
0 siblings, 0 replies; only message in thread
From: Kevin Wolf @ 2011-05-27 9:46 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
You can only delete a BH in its BH handler if you don't call a nested
qemu_bh_poll afterwards (the nested one would free the BH and the outer one
segfaults when returning from the BH handler).
To avoid this situation, first call the callback and only then delete the BH.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/blkdebug.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/block/blkdebug.c b/block/blkdebug.c
index cd9eb80..45bbab8 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -316,8 +316,8 @@ static int blkdebug_open(BlockDriverState *bs, const char *filename, int flags)
static void error_callback_bh(void *opaque)
{
struct BlkdebugAIOCB *acb = opaque;
- qemu_bh_delete(acb->bh);
acb->common.cb(acb->common.opaque, acb->ret);
+ qemu_bh_delete(acb->bh);
qemu_aio_release(acb);
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-27 9:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 9:46 [Qemu-devel] [PATCH] blockdbg: Fix Bottom Half deletion Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).