From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvpr2-0002q4-Vp for qemu-devel@nongnu.org; Fri, 10 Feb 2012 07:45:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvpqy-0006v9-MS for qemu-devel@nongnu.org; Fri, 10 Feb 2012 07:45:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvpqy-0006un-Dc for qemu-devel@nongnu.org; Fri, 10 Feb 2012 07:45:28 -0500 From: Kevin Wolf Date: Fri, 10 Feb 2012 13:47:43 +0100 Message-Id: <1328878064-4907-15-git-send-email-kwolf@redhat.com> In-Reply-To: <1328878064-4907-1-git-send-email-kwolf@redhat.com> References: <1328878064-4907-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 14/15] sheepdog: fix co_recv coroutine context List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: 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 Signed-off-by: Kevin Wolf --- 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.6.5