qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [PATCH] rdma: fix error check


From: Michael R. Hines
Subject: Re: [Qemu-stable] [PATCH] rdma: fix error check
Date: Tue, 24 Sep 2013 14:09:06 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 08/23/2013 04:44 AM, Jie Yang wrote:
Error message is placed wrong place. It will never be printed to warn the user.

Signed-off-by: Frank Yang <address@hidden>
---
 migration-rdma.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/migration-rdma.c b/migration-rdma.c
index 3d1266f..968fbc1 100644
--- a/migration-rdma.c
+++ b/migration-rdma.c
@@ -1585,12 +1585,8 @@ static int qemu_rdma_post_send_control(RDMAContext *rdma, uint8_t *buf,
 
 
     if (ibv_post_send(rdma->qp, &send_wr, &bad_wr)) {
-        return -1;
-    }
-
-    if (ret < 0) {
         fprintf(stderr, "Failed to use post IB SEND for control!\n");
-        return ret;
+        return -1;
     }
 
     ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_SEND_CONTROL, NULL);
-- 
1.8.3.msysgit.0

NACK:

This only partially fixes the bug, actually. Instead, please do the following:

/* many IB functions return positive errors, not negative errors */

ret = ibv_post_send(rdma->qp, &send_wr, &bad_wr));

if (ret > 0) {
    fprintf(stderr, "Failed to post IB SEND for control!\n");
    return -ret;
}

- Michael

reply via email to

[Prev in Thread] Current Thread [Next in Thread]