All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com, lvivier@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 3/6] migration/rdma: fix qemu_rdma_block_for_wrid error paths
Date: Tue, 18 Jul 2017 09:20:42 +0800	[thread overview]
Message-ID: <20170718012042.GW27284@pxdev.xzpeter.org> (raw)
In-Reply-To: <20170717110936.23314-4-dgilbert@redhat.com>

On Mon, Jul 17, 2017 at 12:09:33PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> The two places that 'goto err_block_for_wrid' weren't setting ret
> and so would end up returning 0 even though we've failed.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  migration/rdma.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 6111e10c70..59810aec2e 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -1521,14 +1521,16 @@ static int qemu_rdma_block_for_wrid(RDMAContext *rdma, int wrid_requested,
>              yield_until_fd_readable(rdma->comp_channel->fd);
>          }
>  
> -        if (ibv_get_cq_event(rdma->comp_channel, &cq, &cq_ctx)) {
> +        ret = ibv_get_cq_event(rdma->comp_channel, &cq, &cq_ctx);
> +        if (ret) {
>              perror("ibv_get_cq_event");
>              goto err_block_for_wrid;
>          }
>  
>          num_cq_events++;
>  
> -        if (ibv_req_notify_cq(cq, 0)) {
> +        ret = -ibv_req_notify_cq(cq, 0);

(I didn't really notice that it is returning a positive value for
 error...)

Reviewed-by: Peter Xu <peterx@redhat.com>

> +        if (ret) {
>              goto err_block_for_wrid;
>          }
>  
> @@ -1564,6 +1566,8 @@ err_block_for_wrid:
>      if (num_cq_events) {
>          ibv_ack_cq_events(cq, num_cq_events);
>      }
> +
> +    rdma->error_state = ret;
>      return ret;
>  }
>  
> -- 
> 2.13.0
> 

-- 
Peter Xu

  reply	other threads:[~2017-07-18  1:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 11:09 [Qemu-devel] [PATCH v4 0/6] A bunch of RDMA fixes Dr. David Alan Gilbert (git)
2017-07-17 11:09 ` [Qemu-devel] [PATCH v4 1/6] migration/rdma: Fix race on source Dr. David Alan Gilbert (git)
2017-07-17 11:09 ` [Qemu-devel] [PATCH v4 2/6] migration: Close file on failed migration load Dr. David Alan Gilbert (git)
2017-07-17 19:49   ` Juan Quintela
2017-07-17 11:09 ` [Qemu-devel] [PATCH v4 3/6] migration/rdma: fix qemu_rdma_block_for_wrid error paths Dr. David Alan Gilbert (git)
2017-07-18  1:20   ` Peter Xu [this message]
2017-07-18 19:04     ` Dr. David Alan Gilbert
2017-07-17 11:09 ` [Qemu-devel] [PATCH v4 4/6] migration/rdma: Allow cancelling while waiting for wrid Dr. David Alan Gilbert (git)
2017-07-18  1:23   ` Peter Xu
2017-07-17 11:09 ` [Qemu-devel] [PATCH v4 5/6] migration/rdma: Safely convert control types Dr. David Alan Gilbert (git)
2017-07-17 16:20   ` Juan Quintela
2017-07-17 11:09 ` [Qemu-devel] [PATCH v4 6/6] migration/rdma: Send error during cancelling Dr. David Alan Gilbert (git)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170718012042.GW27284@pxdev.xzpeter.org \
    --to=peterx@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.