OSDN Git Service

sheepdog: fix co_recv coroutine context
authorMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Mon, 30 Jan 2012 17:10:06 +0000 (02:10 +0900)
committerKevin Wolf <kwolf@redhat.com>
Thu, 9 Feb 2012 15:17:51 +0000 (16:17 +0100)
commit6d1acda8f16d1f2d0b05cfbf9ce54d05849cb016
treed599e4aaec47997afabded247f57659ee0a1c642
parentc9b308d20b642c106048f088ccc31f2aa7cf59ba
sheepdog: fix co_recv coroutine context

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>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/sheepdog.c