From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSmiC-0003SY-Mx for qemu-devel@nongnu.org; Tue, 22 Nov 2011 04:32:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSmi8-0008NM-Lt for qemu-devel@nongnu.org; Tue, 22 Nov 2011 04:32:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSmi8-0008NB-4U for qemu-devel@nongnu.org; Tue, 22 Nov 2011 04:32:16 -0500 Message-ID: <4ECB6CD0.8010906@redhat.com> Date: Tue, 22 Nov 2011 10:35:12 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1321930618-607-1-git-send-email-wdongxu@linux.vnet.ibm.com> In-Reply-To: <1321930618-607-1-git-send-email-wdongxu@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block:avoid deadlock in sheepdog.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dong Xu Wang Cc: qemu-devel@nongnu.org, MORITA Kazutaka , stefanha@linux.vnet.ibm.com Am 22.11.2011 03:56, schrieb Dong Xu Wang: > From: Dong Xu Wang > > s->lock should be unlocked before leaving add_aio_request. > > Signed-off-by: Dong Xu Wang Thanks, applied to the block-stable branch (for 1.0). But please keep Kazutaka CCed for future Sheepdog patches. Kevin > --- > block/sheepdog.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/block/sheepdog.c b/block/sheepdog.c > index 9f80609..62f1f3a 100644 > --- a/block/sheepdog.c > +++ b/block/sheepdog.c > @@ -1116,6 +1116,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState *s, AIOReq *aio_req, > /* send a header */ > ret = do_write(s->fd, &hdr, sizeof(hdr)); > if (ret) { > + qemu_co_mutex_unlock(&s->lock); > error_report("failed to send a req, %s", strerror(errno)); > return -EIO; > } > @@ -1123,6 +1124,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState *s, AIOReq *aio_req, > if (wlen) { > ret = do_writev(s->fd, iov, wlen, aio_req->iov_offset); > if (ret) { > + qemu_co_mutex_unlock(&s->lock); > error_report("failed to send a data, %s", strerror(errno)); > return -EIO; > }