diff mbox

RE. [PATCH] sheepdog: fix send req helpers

Message ID 1333447461-317-1-git-send-email-namei.unix@gmail.com
State New
Headers show

Commit Message

Liu Yuan April 3, 2012, 10:04 a.m. UTC
From: Liu Yuan <tailai.ly@taobao.com>

Yes, I think so. Here is the patch.

Subject: [PATCH] sheepdog: fix send req helpers
From: Liu Yuan <tailai.ly@taobao.com>

We should return if reading of the header fails.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
---
 block/sheepdog.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

MORITA Kazutaka April 3, 2012, 11:13 a.m. UTC | #1
At Tue,  3 Apr 2012 18:04:21 +0800,
Liu Yuan wrote:
> 
> From: Liu Yuan <tailai.ly@taobao.com>
> 
> Yes, I think so. Here is the patch.
> 
> Subject: [PATCH] sheepdog: fix send req helpers
> From: Liu Yuan <tailai.ly@taobao.com>
> 
> We should return if reading of the header fails.
> 
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
> ---
>  block/sheepdog.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

Acked-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Kevin Wolf April 3, 2012, 11:34 a.m. UTC | #2
Am 03.04.2012 13:13, schrieb MORITA Kazutaka:
> At Tue,  3 Apr 2012 18:04:21 +0800,
> Liu Yuan wrote:
>>
>> From: Liu Yuan <tailai.ly@taobao.com>
>>
>> Yes, I think so. Here is the patch.
>>
>> Subject: [PATCH] sheepdog: fix send req helpers
>> From: Liu Yuan <tailai.ly@taobao.com>
>>
>> We should return if reading of the header fails.
>>
>> Cc: Kevin Wolf <kwolf@redhat.com>
>> Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
>> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
>> ---
>>  block/sheepdog.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> Acked-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>

Thanks, applied this one as well.

Kevin
diff mbox

Patch

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 62dfa48..73308b2 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -510,6 +510,7 @@  static int send_req(int sockfd, SheepdogReq *hdr, void *data,
     ret = qemu_send_full(sockfd, hdr, sizeof(*hdr), 0);
     if (ret < sizeof(*hdr)) {
         error_report("failed to send a req, %s", strerror(errno));
+        return ret;
     }
 
     ret = qemu_send_full(sockfd, data, *wlen, 0);
@@ -528,6 +529,7 @@  static int send_co_req(int sockfd, SheepdogReq *hdr, void *data,
     ret = qemu_co_send(sockfd, hdr, sizeof(*hdr));
     if (ret < sizeof(*hdr)) {
         error_report("failed to send a req, %s", strerror(errno));
+        return ret;
     }
 
     ret = qemu_co_send(sockfd, data, *wlen);