qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block:avoid deadlock in sheepdog.c
@ 2011-11-22  2:56 Dong Xu Wang
  2011-11-22  9:35 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Dong Xu Wang @ 2011-11-22  2:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, Dong Xu Wang, stefanha

From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>

s->lock should be unlocked before leaving add_aio_request.

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
---
 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;
         }
-- 
1.7.5.4

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

* Re: [Qemu-devel] [PATCH] block:avoid deadlock in sheepdog.c
  2011-11-22  2:56 [Qemu-devel] [PATCH] block:avoid deadlock in sheepdog.c Dong Xu Wang
@ 2011-11-22  9:35 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2011-11-22  9:35 UTC (permalink / raw)
  To: Dong Xu Wang; +Cc: qemu-devel, MORITA Kazutaka, stefanha

Am 22.11.2011 03:56, schrieb Dong Xu Wang:
> From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
> 
> s->lock should be unlocked before leaving add_aio_request.
> 
> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>

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;
>          }

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

end of thread, other threads:[~2011-11-22  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22  2:56 [Qemu-devel] [PATCH] block:avoid deadlock in sheepdog.c Dong Xu Wang
2011-11-22  9:35 ` 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).