qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sheepdog: fix co_recv coroutine context
@ 2012-01-30 17:10 MORITA Kazutaka
  2012-02-09 14:48 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: MORITA Kazutaka @ 2012-01-30 17:10 UTC (permalink / raw)
  To: kwolf; +Cc: stefanha, sheepdog, hch, qemu-devel

The co_recv coroutine has two things that will try to enter it:

  1. The select(2) read callback on the sheepdog socket.
  2. The aio_add_request() blocking operations, including a coroutine
     mutex.

This patch fixes it by setting NULL to co_recv before sending data.

In future, we should make the sheepdog driver fully coroutine-based
and simplify request handling.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
---
 block/sheepdog.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 9416400..00276f6f 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -629,6 +629,9 @@ static void coroutine_fn aio_read_response(void *opaque)
 
     switch (acb->aiocb_type) {
     case AIOCB_WRITE_UDATA:
+        /* this coroutine context is no longer suitable for co_recv
+         * because we may send data to update vdi objects */
+        s->co_recv = NULL;
         if (!is_data_obj(aio_req->oid)) {
             break;
         }
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] sheepdog: fix co_recv coroutine context
  2012-01-30 17:10 [Qemu-devel] [PATCH] sheepdog: fix co_recv coroutine context MORITA Kazutaka
@ 2012-02-09 14:48 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2012-02-09 14:48 UTC (permalink / raw)
  To: MORITA Kazutaka; +Cc: stefanha, sheepdog, hch, qemu-devel

Am 30.01.2012 18:10, schrieb MORITA Kazutaka:
> The co_recv coroutine has two things that will try to enter it:
> 
>   1. The select(2) read callback on the sheepdog socket.
>   2. The aio_add_request() blocking operations, including a coroutine
>      mutex.
> 
> This patch fixes it by setting NULL to co_recv before sending data.
> 
> In future, we should make the sheepdog driver fully coroutine-based
> and simplify request handling.
> 
> Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-09 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-30 17:10 [Qemu-devel] [PATCH] sheepdog: fix co_recv coroutine context MORITA Kazutaka
2012-02-09 14:48 ` 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).